This is an example from the kirby-secrets repo (www to non-www and http to https). You could test if this works for you.
RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L,NE]
There is no SSL option in Kirby 3 anymore, and I’m not sure regarding the c::set() syntax, anyway.
If you have access to the server config, I’d do this in the Virtual Host configuration rather then the .htaccess. On shared hosting, that is of course not possible.
What is your environment/hosting?