You are completely right. What about this? Too ugly?:

    js_catalog_template = \
    r"""{% autoescape off %}
    ...