It is a policy driven trade-off. Yes, it is not portable. But by also comparing against the presumed end of the function, there is an automatic detection of buffer over flow. True, it is a run time detection, but still automatic.
(Yes, we do have code reviews to look for problems, but company policy dictates we automate detection of problems as much as possible.)
Any other method would also be nonportable. If this method broke, then I'd have to devise another way. If there was no other way, I would have to explain to management why it could not be done. Stating that it is not portable would not be good enough.
For that matter, copying code from ROM to RAM and executing is also nonportable.
For what it is worth, my favorite way to get code into RAM is:
unsigned char CodeBuffer[] = { 0xC6, 0x55, 0x5B, 0x3F, 0x58, 0x5B, 0x3F, 0x3D };
This way the compiler will take care of copying it for me as well as making sure the buffer fits the code. Unfortunately, there are technical reasons that require a complex function that can not simply be converted into a constant string of bytes.