So you are on your first job. You are a programmer. And you have been asked to organize a party for 35/40 people. I hope it's a joke on part of your new colleagues. If it's serious, then something is wrong with the company.
In my culture it's kind of normal to tell a new guy or gal, especially if they seem naive, that "every new employee so far bought tons of donuts for the entire office" or "at the evening of your first salary all the drinks are on you". The correct response is always "haha, a good one!".
Even if you initially fell for that, when they nag you again you can always politely say "Aww come on already. I'll buy you a pack of chips tomorrow but I need you to behave.".
What seems off is that they got managers and budget to play along; can they be in such hilarious mood of epic proportions?
If a company has more than 35 employees, then obviously there is a person responsible for arranging such a party. And I mean professional responsibility, it is their job, as policemen giving tickets or as yours is programming. And that person is not a programmer, believe me! (hint hint) They are not taking your programming tasks, you don't do their team-spirit tasks.
Anyway go to your manager and tell them you recognize the wonderful opportunity, but you've decided to pass on that. At this point stop talking and look at them in silence. If reason is required, do tell that your dog fell seriously ill. You have my official permission to act tongue-in-cheek as needed. This will work perfectly whether it was a joke or not.
The very important lesson about professional opportunities is to know which ones to pass. You are not a slave but a skilled worker, so you will let pass most of opportunities in your career. Here, truly the worst case scenario is that you will ruin some of your career options, for example, you will have no chance to become an office attendant, or a PR specialist, or a CEO for this company. But your rating as a programmer, and respect for you, can only go up.
I've just noticed that you're a girl! I came back to re-examine every sentence of my answer and everything still applies. Some of it applies even more seriously. I hope I'm mistaken, but in some cultures - I repeat, in some - if a fresh girl does organize such party successfully, it can lead to future expectations towards her.