### 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
if only_one:
                var_name = only_one.group(1)
                if var_name in self._available_variables:
                    resolved_val = self._available_variables[var_name]
                    if isinstance(resolved_val, NON_TEMPLATED_TYPES):
                        return resolved_val
                    elif resolved_val is None:
                        return C.DEFAULT_NULL_REPRESENTATION
            
            sha1_hash = None
            if cache:
                variable_hash = sha1(text_type(variable).encode('utf-8'))
                options_hash = sha1(
                    (
                        text_type(preserve_trailing_newlines) +
                        text_type(escape_backslashes) +
                        text_type(fail_on_undefined) +
                        text_type(overrides)
                    ).encode('utf-8')
                )
                sha1_hash = variable_hash.hexdigest() + options_hash.hexdigest()
                if sha1_hash in self._cached_result:
                    return self._cached_result[sha1_hash]
            result = self.do_template(
                variable,
                preserve_trailing_newlines=preserve_trailing_newlines,
                escape_backslashes=escape_backslashes,
                fail_on_undefined=fail_on_undefined,
                overrides=overrides,
                disable_lookups=disable_lookups,