Except that it's not. At least on glibc, strlen() is declared "pure" to the compiler and (unless otherwise defeated by pointer aliasing) repeated calls will be optimized away.
That's not to say that this is the best way to write the code, but the concern seems poorly informed.