### 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
''' wrapper for lookup, force wantlist true'''
        kwargs['wantlist'] = True
        return self._lookup(name, *args, **kwargs)
    def _lookup(self, name, *args, **kwargs):
        instance = lookup_loader.get(name, loader=self._loader, templar=self)
        if instance is None:
            raise AnsibleError("lookup plugin (%s) not found" % name)
        wantlist = kwargs.pop('wantlist', False)
        allow_unsafe = kwargs.pop('allow_unsafe', C.DEFAULT_ALLOW_UNSAFE_LOOKUPS)
        errors = kwargs.pop('errors', 'strict')
        loop_terms = listify_lookup_plugin_terms(terms=args, templar=self, loader=self._loader, fail_on_undefined=True, convert_bare=False)
        
        try:
            ran = instance.run(loop_terms, variables=self._available_variables, **kwargs)
        except (AnsibleUndefinedVariable, UndefinedError) as e:
            raise AnsibleUndefinedVariable(e)
        except AnsibleOptionsError as e:
            
            raise e
        except AnsibleLookupError as e:
            
            msg = 'Lookup failed but the error is being ignored: %s' % to_native(e)
            if errors == 'warn':
                display.warning(msg)
            elif errors == 'ignore':
                display.display(msg, log_only=True)
            else:
                raise e
            return [] if wantlist else None
        except Exception as e: