The fun part about buried peanuts is that, if the shell remains sealed, it’s gas-tight, so you get anaerobic decomposition.
And anaerobically-decomposed peanuts are, in fact, one of the most amazingly awful, disgusting, nauseating smells you’re ever likely to encounter.
Even without benefit of chemotherapy-nausea, it’s an utterly revolting, genuinely stomach-turning smell. And the peanut shells can pop open and spray the nasty liquid all over when one is digging in the garden.
So, if you must give the little critters peanuts, please crack the shells first.
Better yet, give’m something like shell walnuts that will stand up well to being buried, and provide useful nutrition when dug up later.
Peanuts are not a good choice for squirrels, because even if the peanuts don’t rot, they often harbor aflatoxin-producing fungi, which squirrels are very susceptible to.