Static constants do have another advantage besides optimization: They can be placed in read-only memory, so if someone editing this code did take a pointer to the constant and accidentally modify it, it would be obvious because the code would segfault. In my opinion that is a "nice to have" even though, like the optimization benefit, it doesn't matter very much in this particular case.
Please let's avoid that kind of "optimization", it doesn't make any sense.
I don't think there's anything to change it, but if you absolutely want to get rid of the magic number, just replace it by strlen().