Cream pies are comestibles and can be eaten or thrown. Keystone Kops will throw them at you, making you temporarily blind, for up to 25 (more) turns. If you are hit by a cream pie, you can #wipe your face or apply a towel to regain sight faster. It is possible to apply a cream pie to yourself; this in effect makes you blind.
You can also wield a cream pie if you want to avoid killing monsters. Throwing a cream pie, or hitting with a wielded one, does not break any conducts. Eating the pie breaks the vegan conduct but preserves the vegetarian conduct.
Zapping a cream pie with a wand of striking, or hitting it with a force bolt spell, gives the message "What a mess!" and destroys the cream pie.
In NetHack 3.4.3 and earlier versions, applying or otherwise destroying a wielded cream pie can crash the game (Bug C343-218). You are safe if you immediately wield w something else or even nothing -, or if you save and restore the game.
Cream pies can sometimes be a useful, if limited, source of blindness (for telepathy) if the RNG has refused to provide you with a blindfold or a towel. The fact that each pie can only be used once is somewhat compensated for by the copious numbers in which Kops drop them when killed.
The usefulness of cream pies as a food source is limited due to their low nutrition to weight ratio.
Pacifist players will often wield a cream pie (or a whole stack of them) to avoid doing any damage if they accidentally hit a monster.
Attacking a monster capable of delivering a gaze attack with a cream pie can make that monster considerably less formidable. The cream will wear off with time, so repeated application may be necessary.