### Summary

`ansible.template.is_template` tries to loop until it determines if the value is indeed a template.  Which means we could loop extremely large strings, that don't even remotely look like templates, before we bail.

However, we could benefit from moving `Templar.is_possibly_template` to the global scope, and testing whether the value after `jinja_env.preprocess` is even possibly a template, before doing more computationally complex validation.

### Issue Type

Feature Idea

### Component Name

lib/ansible/template/__init__.py

### Additional Information

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)

```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
'''
        A custom finalize method for jinja2, which prevents None from being returned. This
        avoids a string of ``"None"`` as ``None`` has no importance in YAML.
        If using ANSIBLE_JINJA2_NATIVE we bypass this and return the actual value always
        '''
        if _is_rolled(thing):
            
            
            
            
            
            
            return list(thing)
        if self.jinja2_native:
            return thing
        return thing if thing is not None else ''
    def _fail_lookup(self, name, *args, **kwargs):
        raise AnsibleError("The lookup `%s` was found, however lookups were disabled from templating" % name)
    def _now_datetime(self, utc=False, fmt=None):
        '''jinja2 global function to return current datetime, potentially formatted via strftime'''
        if utc:
            now = datetime.datetime.utcnow()
        else:
            now = datetime.datetime.now()
        if fmt:
            return now.strftime(fmt)
        return now
    def _query_lookup(self, name, *args, **kwargs):