I was going to suggest using bool to determine truthy/falsy. However, it doesn’t support negative values or single letters like Y and N.
{% set x = ['ON', 'on', 'On', 'TRUE', 'True', 'true', true,
'OFF', 'off', 'Off', 'FALSE', 'False', 'false', false] %}
{{ x | map('bool') | list }}
{{ -7 | bool }}
