Nearly all engines support the FRIK_FILE extension (or even the old QSG_FILE), which adds the functions strzone and strunzone.
local string s;
s = strzone (whatever_string);
will allocate memory on the zone (you can read more about the zone... somewhere), then strcpy the string into there. After that, the string can be used for such things. Just be sure to unzone after:
strunzone (s);
This will free the memory used. After strunzone, s will be a pointer to unallocated space, so don't try to reference it afterwards.