Why does 'tomnoddy' mean 'dunce'?

I'm looking for the etymology of the word tomnoddy which, according to Wiktionary, either refers to a puffin or a fool or dunce.

From Tolkien's The Hobbit,

Old Tomnoddy, all big body,
Old Tomnoddy can't spy me!


Solution 1:

This one’s complicated in a fun way, according to the history related by Merriam-Webster. A word for a small garden snail came to be used for small, stout-bodied men (especially in a scornful way) and for small, stout-bodied birds, and mutated considerably as it traveled over time.

In the beginning, there was dodman. We don’t know its origin, but it meant, and in some locales still means, a snail. (See more at Wikipedia.) This was altered to

hodmadod, “snail” or “snail shell”, which acquired a secondary meaning of “deformed or clumsy person” or “scarecrow”. This in turn altered to

hoddy-doddy, also meaning “garden snail” or “snail shell”, and additionally used to mean “short and stout person”, “henpecked man”, “cuckold”, and “fool, blockhead, simpleton”. Then, much like the compounds “lamebrain” and “blockhead”,

hoddypoll began to be seen. From hoddy-doddy + poll (head), it meant “fumbling inept person” or “cuckold”, but apparently also preserved the original sense of small and stout-bodied: it was shortened and altered by way of noddypoll to

noddy as early as 1530, meaning “stupid person” but also a kind of stout-bodied tern, which brings us to

tomnoddy, from Tom (nickname for Thomas) + noddy, meaning “fool, dunce, noddy” but in Scotland also a kind of Atlantic puffin. It is like calling someone Jack Pumpkinhead or Joe Cool.

When Tolkien uses it

Old Tomnoddy, all big body,
Old Tomnoddy can’t spy me!

it is clear he is using it in both its sense of “stout-bodied” as well “inept” or “stupid”.