Okay, I'd plan on feeding everyone who responded yes so far and probably half of the classmates. I would also go with hot dogs which are cheaper and easier to store if you have extras. Plus you're only buying one kind of bun and one kind of meat so you don't have to worry about how many will want or want the other. Adults can eat hot dogs too, it's okay. Aldi does have good prices on things like chips and stuff and they sometimes have fruit by the foot stuff too, just look around. If you have a Costco membership you can get hot dogs and buns for pretty cheap there too. As far as a goody bag, well it's okay not to do one, but I always like to do it, so a cheap way to satisfy the need is to get each kid a helium filled balloon and tie it to a blow pop or Tootsie Pop. You can use them as decorations for the party and then send one home with each kid. Kids love balloons, especially tied to candy. I would probably do a goody bag for 40 kids, if your kid doesn't get one, that's okay. BUT, if you do balloons you kind of need to do those at the last minute so you may have better numbers by then, at least hopefully! And extra candy can just be thrown into the Trick or Treat bowl in a month!
You can make the cupcakes yourself for pretty cheap and have him help you decorate them with sprinkles or M&Ms.