Is it safe to use $vars['name_raw'] instead of $vars['name']?
For this particular instance you should be fine because usernames already are filtered to a limited set of characters.

Like you assumed *_raw is unfiltered input. So in almost any other circumstance, it should be sanitized in some way before use.