Sadly the AIs (nethackchallenge.com) are not yet good enough to show us what closer to optimal play looks like.
I'm disappointed that DJB didn't automate polypiling until he got what he wanted, rather than just rolling new characters until getting the desired combination of resources. At that point, I'd just say that save game editing and RNG grinding are comparable...
If you're reading this, DJB, thanks for all the awesome and weird tools! Perhaps you're not as widely attributed as you should be but I see your influences everywhere in modern unix.
(edited to change "fingerprints" to "influences" -- things like systemd or the later solaris init replacement are clearly a funhouse mirror re-imagning of daemontools and family -- but fingerprints implies that DJB touched these things which I'm pretty confident he didn't)
* Always retrace your own steps when backtracking. Only walk on new tiles when it’s absolutely necessary for exploration. This greatly reduces your chances of stepping on unseen traps.
* Abuse shops to the max. Price ID everything you find. Sell every last bit of junk. Engage in credit cloning. Steal everything from shops.
* Abuse the protection racket. Max out on divine protection by spending all of the money from every shopkeeper’s pocket at the temple in minetown.
* Abuse alchemy to make large stacks of holy water and blessed potions of full healing. Increase your max HP to several hundred.
* Pudding farming. This one has thankfully been patched out.
* Polypiling. Polymorph lines of items on the floor. Try to get magic markers to write more scrolls of enchant armour.