Inserting external script directly after opening <head>-Tag

Hi,
I want to use a external consent management solution and to get this solution work properly, the script tag needs to get implemented directy after the opening -tag, so that all the other scripts and resources are getting loaded afterwards. This is necessary as the consent management script can only control resources which gets loaded afterwards.

Is there a way to implement the script directly after the opening -tag?
I hope you can help me.