How do I properly detect if region is empty?
try to apply filters after render, like this : 

{% set has_sidebar_first = page.sidebar_first|render|striptags|trim is not empty %}
{% if has_sidebar_first %}
    {# ... #}
{% endif %}