Github issue #1 is now addressed and resolved.
Iterating on the light/dark theme upload scripts TMNT IT management has added the capability to iterate over all SharePoint sites and apply the dark theme as default.
The updated script https://github.com/EivindBerge/PIZZA-TIME-ACDC-2022/blob/main/theming/site-theme-management-tmnt.ps1 is running in a scheduled Azure Run Book using PowerShell Core 7.1. SharePoint Online Credentials are as runbook credentials, which is sufficient for this scenario. Key Vault could of course be an option, or even better using a certificate – but as IT is very centralized this works for the time being.
We have also added more code and security scanning tools to also cover PowerShell scripts and find more general security issues.