@ NathanS 'answer covers the choking rules that seem very applicable to this situation, but I wanted to cover if holding my breath is an effective strategy.
Your example of the golem
In your question, you declare:
The party is fighting some creature with immunity to poison, such as the golem
Looking at the golems with poison breath, that suggests that you are discussing the Iron Golem.
The Iron Golem Poisonous Breath (emphasis is mine):
The golem exhales poisonous gas in a 15-foot cone. Every creature in that area You must take a save shot of the Constitution of DC 19, receiving 45 (10d8) damage per poison in a failed save, or half damage in a successful one.
The effect works on every creature in the area. It does not say that it points to each creature that breathes, but only to each creature. A DM can always rule how they would like to, but RAW, the effect works against any creature. Poisonous gas does not necessarily have to be inhaled to work: it can enter by other means.
Effects of poison / gas in general
If the effect does not specify "creatures that can breathe," then it usually works either breathing or not.
As I said before, if a DM wants to decide that you need to breathe to be affected, it's totally fine.
Most importantly, the Basic Rules cover the different types of poison and the notes that holding your breath against the inhaled variety is not effective:
Inhaled. These poisons are powders or gases that take effect when inhaled. Blowing the dust or releasing the gas puts the creatures in a 5-foot cube to their effect. The resulting cloud dissipates immediately after. Holding your breath is ineffective against inhaled poisons, as they affect the nasal membranes, tear ducts and other parts of the body.
The other types of venom are contact, ingestion and lesions, none of which would hold your breath would be an effective way to avoid its effects.
The curious case of cloudkill
It gets a little twisted with things like cloudkill What states:
When a creature enters the spell area for the first time in a turn or begins its turn there, that creature must make a saving shot of the Constitution. The creature takes 5d8 of poison damage in a failed save, or half damage in a successful one. Creatures are affected even if they hold their breath or do not need to breathe.
This line suggests that other things may allow him to hold his breath and I'm really not sure why they had to say that. Given that, it is absolutely plausible that a DM governs in other cases that may hold his breath.