### Summary

I'm rendering template with special header to change the variable/block start/end string:

```txt
#jinja2:variable_start_string:'<<' , variable_end_string:'>>', block_start_string:'<%', block_end_string:'%>'
```

When rendering this template, some host variables aren't rendered correctly, because the escape sequence override also applies to how these variables are parsed.

### Issue Type

Bug Report

### Component Name

template

### Ansible Version

```console
$ ansible --version
ansible [core 2.11.1] 
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/toolset/lib/python3.8/site-packages/ansible  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/toolset/bin/ansible
  python version = 3.8.10 (default, May 12 2021, 15:56:47) [GCC 8.3.0]
  jinja version = 3.0.1
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = True
```


### OS / Environment

For this I'm using `quay.io/ansible/toolset` docker image. (running in CI) but I was able to reproduce it on Ubuntu the same way.

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
#playbook.yml
---
- name: Reproduce issue
  hosts: localhost
  vars:
    var_a: "value"
    var_b: "{{ var_a }}"
    var_c: "<< var_a >>"
  gather_facts: false
  tasks:
    - set_fact:
        var_d: "{{ var_a }}"
    - template:
        dest: ./rendered.txt
        src: ./template.j2
```
Template:
```txt
#jinja2:variable_start_string:'<<' , variable_end_string:'>>', block_start_string:'<%', block_end_string:'%>'
Here should be var_a: << var_a >>
Here should be var_b: << var_b >>
Here should be var_c: << var_c >>
Here should be var_d: << var_d >>
```

### Expected Results

```console
❯ cat rendered.txt
Here should be var_a: value
Here should be var_b: value
Here should be var_c: << var_a >>
Here should be var_d: value
```

### Actual Results

```console
❯ cat rendered.txt
Here should be var_a: value
Here should be var_b: {{ var_a }}
Here should be var_c: value
Here should be var_d: value
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
warning_text = '{0} "{1}" is deprecated'.format(self._dirname, key)
                display.deprecated(warning_text, version=removal_version, date=removal_date, collection_name=acr.collection)
            tombstone_entry = routing_entry.get('tombstone')
            if tombstone_entry:
                warning_text = tombstone_entry.get('warning_text')
                removal_date = tombstone_entry.get('removal_date')
                removal_version = tombstone_entry.get('removal_version')
                if not warning_text:
                    warning_text = '{0} "{1}" has been removed'.format(self._dirname, key)
                exc_msg = display.get_deprecation_message(warning_text, version=removal_version, date=removal_date,
                                                          collection_name=acr.collection, removed=True)
                raise AnsiblePluginRemovedError(exc_msg)
            redirect_fqcr = routing_entry.get('redirect', None)
            if redirect_fqcr:
                acr = AnsibleCollectionRef.from_fqcr(ref=redirect_fqcr, ref_type=self._dirname)
                display.vvv('redirecting {0} {1} to {2}.{3}'.format(self._dirname, key, acr.collection, acr.resource))
                key = redirect_fqcr
            
            func = self._collection_jinja_func_cache.get(key)
            if func:
                return func
            try:
                pkg = import_module(acr.n_python_package_name)
            except ImportError:
                raise KeyError()
            parent_prefix = acr.collection
            if acr.subdirs:
                parent_prefix = '{0}.{1}'.format(parent_prefix, acr.subdirs)
            
            for dummy, module_name, ispkg in pkgutil.iter_modules(pkg.__path__, prefix=parent_prefix + '.'):