A CGI script by itself is incomplete -- it expects a web server of some sort to open a socket, accept a connection, parse HTTP headers, populate environmental variables and send data back to the client. Compiling or rewriting your CGI script doesn't obviate the need for something to handle the HTTP side of the equation.
So, you're right. There's not an easy way to do what you ask. There are several alternative paths that are not too odious.