### Summary

While templating a JSON file where the JSON was created as part of a template (without using `to_json`) and where a macro was used to template some repeated parts, we found out that the generated JSON file was invalid JSON after switching from ansible-core 2.12 to ansible-core 2.13.

The problem seems to be that if the output of a macro looks like something that could be a Pyhon `repr()` result, it is converted back to Python datastructures.

### Issue Type

Bug Report

### Component Name

templar

### Ansible Version

```console
2.13.0
devel branch
```


### Configuration

```console
default
```


### OS / Environment

Linux

### Steps to Reproduce

```.bash
ansible localhost -m debug -a "msg='{% macro foo() %}{ "'"'"foo"'"'": "'"'"bar"'"'" }{% endmacro %}Test: {{ foo() }}'"
```
Or as a task:
```.yaml
- hosts: localhost
  tasks:
  - debug:
      msg: >-
        {% macro foo() %}{ "foo": "bar" }{% endmacro %}Test: {{ foo() }}
```


### Expected Results

```
"Test: {\"foo\": \"bar\"}"
```

### Actual Results

```console
"Test: {'foo': 'bar'}"
```
(This has `'` instead of `"`, so this isn't valid JSON.)
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
data_newlines = _count_newlines_from_end(data)
        if fail_on_undefined is None:
            fail_on_undefined = self._fail_on_undefined_errors
        has_template_overrides = data.startswith(JINJA2_OVERRIDE)
        try:
            
            
            
            if overrides:
                myenv = self.environment.overlay(overrides)
            elif has_template_overrides:
                myenv = self.environment.overlay()
            else:
                myenv = self.environment
            
            if has_template_overrides:
                eol = data.find('\n')
                line = data[len(JINJA2_OVERRIDE):eol]
                data = data[eol + 1:]
                for pair in line.split(','):
                    if ':' not in pair:
                        raise AnsibleError("failed to parse jinja2 override '%s'."
                                           " Did you use something different from colon as key-value separator?" % pair.strip())
                    (key, val) = pair.split(':', 1)
                    key = key.strip()
                    setattr(myenv, key, ast.literal_eval(val.strip()))
            if escape_backslashes:
                
                data = _escape_backslashes(data, myenv)
            try: