We started with ir.varname_to_string, which performed some annoying escaping to make the variable name look like a regular identifier. It turned out that this was only really useful for backends that generate code for programming languages (e.g., Python), and that was backend-specific. In most cases, it is best not to escape variable names. Thus ir.varname_to_string_noescape was born, which is now used throughout the codebase as a means of stringifying varnames. There is also ir.varname_to_string_dodgy and I'm not sure what that's used for, but it sounds ... dodgy.
No code anywhere should be using anything other than ir.varname_to_string_noescape. As a special exception, a future backend which generates programming code (such as Python or JavaScript) might have its own special escaping function, but that would be part of the backend, not core functionality.
Delete ir.varname_to_string and ir.varname_to_string_dodgy and fix up any calls to those functions. Rename ir.varname_to_string_noescape to simply ir.varname_string. I am sick of typing that.
The only remaining call to varname_to_string is in tables, in an error message. This would be improved by changing it into a call to varname_ to_string_ noescape. There are no remaining calls to varname_ to_string_ dodgy. I wonder what that was for?