How do I give a CGI script permission to access Calendar?
The nobody user is non-interactive and doesn’t have calendars anyways. You will need to have some component (maybe another custom app/process) running as you to deliver the calendar info. 

You really have two options, one of which is very bad.

Firstly, you could have your CGI scripts run as you. This isn’t hard but super dangerous and not recommended.

Secondly, you can build what is essentially a calendar proxy. This could be another program (running as you) which ever five minutes reads the calendar data and writes it out to a file which nobody, the account, can read. You already seem to be familiar and working just fine with calendars so this shouldn’t be an issue, it’s just another script that you schedule with cron.

Another thing, though I’m really not sure if it will work for nobody, is that you can run sudo su nobody and then launch it. Since OSX knows that the PTTY is attached to your user session it will show the prompt there for you to accept. While you still won’t be able to access your users calendars, this trick is useful if you have to use these sorts of permissions as root whom also doesn’t a graphical session.