I’ve solved my issue differently, but I’ve just realized that it’s possible to have unsafe shortcode that would just contain {{ .Inner }}, that way it’s possible to insert html tags without even setting unsafe=true for the entire page.
E.g.
Create layout/shortcodes/unsafe.html with the following content: {{ .Inner }}.