You can escape all dollar signs before rendering with str.replace("$", "\$"). Check this other post for an example:
str.replace("$", "\$")