### 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
ret = func(*args, **kwargs)
        if _is_rolled(ret):
            return list(ret)
        return ret
    return _update_wrapper(wrapper, func)
def _update_wrapper(wrapper, func):
    
    
    for attr in ('__module__', '__name__', '__qualname__', '__doc__', '__annotations__'):
        try:
            value = getattr(func, attr)
        except AttributeError:
            pass
        else:
            setattr(wrapper, attr, value)
    for attr in ('__dict__',):
        getattr(wrapper, attr).update(getattr(func, attr, {}))
    wrapper.__wrapped__ = func
    return wrapper
def _wrap_native_text(func):
    """Wrapper function, that intercepts the result of a filter
    and wraps it into NativeJinjaText which is then used
    in ``ansible_native_concat`` to indicate that it is a text
    which should not be passed into ``literal_eval``.
    """
    def wrapper(*args, **kwargs):
        ret = func(*args, **kwargs)
        return NativeJinjaText(ret)
    return _update_wrapper(wrapper, func)
class AnsibleUndefined(StrictUndefined):