2👍
✅
It sounds like what you want is something more along the lines of:
{% with foo=excessively_verbose.chain_of_long.nested_references %}
{% if foo %}
{{ foo }} bar
{% endif %}
{% endwith %}
Source:stackexchange.com