All callers of this function use temporary storage for the input. Instead of copying strings, move them.