Yes, you need str_create() inside a function. Also, take care that the string is not created again whenever you call the function - otherwise the memory is slowly consumed up.
On that occasion, I suggest that when you have the choice, prefer create() functions over global definitions. When you want to port your project later to phone APIs such as Android with a future Gamestudio version, you will have to use create functions for engine objects.