When a stone golem is killed, it leaves a statue (of a stone golem) rather than a corpse. The contents of the statue is from the killed stone golem's inventory which is likely empty; the stone golem never picks up items, and it is mindless and has no items when generated. it is generated, so it is unlikely to be worth breaking the statue for a spellbook. A randomly generated statue of stone golem in dungeon may still contain one spellbook.
Casting stone to flesh on the "animated" stone golem will turn it into a flesh golem. Stoning this flesh golem will turn it back to a stone golem. Casting stone to flesh on its statue will create a single meatball, because the golem is not considered a fleshy monster.
"The original story harks back, so they say, to the sixteenth
century. Using long-lost formulas from the Kabbala, a rabbi is
said to have made an artificial man -- the so-called Golem -- to
help ring the bells in the Synagogue and for all kinds of other
"But he hadn't made a full man, and it was animated by some sort
of vegetable half-life. What life it had, too, so the story
runs, was only derived from the magic charm placed behind its
teeth each day, that drew down to itself what was known as the
`free sidereal strength of the universe.'
"One evening, before evening prayers, the rabbi forgot to take
the charm out of the Golem's mouth, and it fell into a frenzy.
It raged through the dark streets, smashing everything in its
path, until the rabbi caught up with it, removed the charm, and
destroyed it. Then the Golem collapsed, lifeless. All that was
left of it was a small clay image, which you can still see in
the Old Synagogue." ...
- apply.c in NetHack 3.4.3, line 2312
- dokick.c in NetHack 3.4.3, line 439
- dothrow.c in NetHack 3.4.3, line 763
- dothrow.c in NetHack 3.4.3, line 811
- eat.c in NetHack 3.4.3, line 466
- eat.c in NetHack 3.4.3, line 1717
- mhitu.c in NetHack 3.4.3, line 1194
- mhitu.c in NetHack 3.4.3, line 1940
- mthrowu.c in NetHack 3.4.3, line 414
- pickup.c in NetHack 3.4.3, line 1310
- pickup.c in NetHack 3.4.3, line 1824
- pickup.c in NetHack 3.4.3, line 1947
- steed.c in NetHack 3.4.3, line 86
- trap.c in NetHack 3.4.3, line 2169
- trap.c in NetHack 3.4.3, line 3344
- uhitm.c in NetHack 3.4.3, line 2193
- mon.c in NetHack 3.4.3, line 259
- mkobj.c in NetHack 3.4.3, line 929: mkcorpstat() calls mksobj_at() which may add spellbooks to the statue. But then mkcorpstat() calls save_mtraits() which will override the contents of the statue and transfer previous killed monster's inventory to the statue.
- makemon.c in NetHack 3.4.3, line 918
- makemon.c in NetHack 3.4.3, line 1534