You can use an uncarved pumpkin to spawn an iron golem, in addition to the correct jack o'lantern/carved pumpkin.
Steps to reproduce:
- Make a T shape out of iron blocks.
- Place a regular pumpkin on the top middle iron block.
The pumpkin is placed on the iron block – a carved pumpkin or jack o'lantern should be required.
An iron golem is spawned.