c) If you already know some C, just use PHP (or Perl) and save yourself the hassle of compiling stuff, and the slowness of running it under CGI.
I'm confused by the "slowness of running it under CGI" part. Can you explain a bit more?
I should have written "as CGI" instead of "under CGI", which doesn't make much sense.
When a scripting language is run via CGI, a new Apache/IIS process has to be created. When they're run via the respective webserver modules this overhead can be avoided. AFAIK FastCGI is a lot better, but a module is still preferable.
Even if performance isn't something to worry about in this specific case, there's little reason for the OP to have to run the rigmarole of writing / compiling / deploying a C program when a much more convenient script equivalent would do.