Having a different character set when compiling a function can impact the performance of the function significantly.
The function itself has the proper character sets for input parameters and the result.
Have a look at the attached function. In the following sequence you would observe that the execution is almost 10 times slower for just 10000 invocation and the only difference is the character set set when compiling the function.
If this is expected behaviour it should be well documented, but I couldn't find anything on the subject.