I just stick a door on the nesting area and lock it whenever I want the animal population to increase.
But an (O)rder whether or not to harvest eggs could be nice, too. Or maybe a setting on a box by box basis, but that could be complicated...
With the recent closing of "breeding by spores" (v0.40.19), the locked door solution has become a lot trickier to pull off.
There is also the edge case of elk birds: they are grazers, so it generally makes sense to pasture them with the other grazers. However, the other grazers can mostly be milked or sheared, so dwarves need access to the area. How do you let the elk birds graze while keeping the eggs safe?
I specifically want the "don't collect eggs from this box" setting to allow controlling population growth without completely eliminating it. For example:
1. Turkeys are great for egg production. I embark with three hens and a gobbler.
2. Turkeys are also large, and produce plenty of meat and tallow. I want to divert some eggs for hatching so I can butcher the chicks once they grow up.
3. Ideally, I want to collect eggs from two of the three nest boxes, and hatch chicks in the third.
4. Stockpile and cooking settings don't permit this sort of detail. You end up either collecting from all three (which means no extra turkeys to butcher later) or none of the three (which means a birdsplosion).
The "setting on a box by box basis" is the feature requested in the OP. If hives already have a similar setting (I haven't played enough with beekeeping to know) then "automatically forbid eggs laid in this box" shouldn't be that hard.