Yes, I was going to say that too. Modern "serverless" is basically this - spawning a script to handle a request on-demand.
And because of serverless, there are frameworks optimized for low startup time, and those frameworks would probably work pretty well for CGI too.