If the value passed to os.path.expandvars() is user-controlled a performance degradation is possible when expanding environment variables.