If your site uses AMP (accelerated mobile pages) in combination with Really Simple SSL, you might encounter an error regarding javascript in the head of the website.
If you see this error, you have the option “javascript redirect to SSL” enabled in settings/ssl.
The solution is simple: just deactivate this redirect, and the inline script is gone.
The javascript redirect is actually a fallback redirect, which in most cases should not be used anyway. The WP redirect or .htaccess redirect are the recommended way of redirection, of which I prefer the .htaccess redirect. It’s the fastest and most reliable one.