First, I came across a post on the Of Small Wonders & Great Wanders blog about the ancient art of self-mummification, developed by ascetic monks of the Shingon sect in northern Japan:
This led me to wikipedia page about Sokushinbutsu, which further explains:
For 1,000 days the priests would eat a special diet consisting only of nuts and seeds, while taking part in a regimen of rigorous physical activity that stripped them of their body fat. They then ate only bark and roots for another thousand days and began drinking a poisonous tea made from the sap of the Urushi tree, normally used to lacquer bowls.
This caused vomiting and a rapid loss of bodily fluids, and most importantly, it made the body too poisonous to be eaten by maggots. Finally, a self-mummifying monk would lock himself in a stone tomb barely larger than his body, where he would not move from the lotus position. His only connection to the outside world was an air tube and a bell. Each day he rang a bell to let those outside know that he was still alive.
When the bell stopped ringing, the tube was removed and the tomb sealed. After the tomb was sealed, the other monks in the temple would wait another 1,000 days, and open the tomb to see if the mummification was successful. If the monk had been successfully mummified, they were immediately seen as a Buddha and put in the temple for viewing. Usually, though, there was just a decomposed body. Although they were not viewed as a true Buddha if they were not mummified, they were still admired and revered for their dedication and spirit.
The self-mummified body of Chûkai Shônin
The wikipedia page, in turn, led me to a 1962 article in the Journal History of Religions: "Self-Mummified Buddhas in Japan," by Ichiro Hori. The article provides a great deal of information about the development of the art of self-mummification — much much detail than I'll go into here. The important point (since it leads us to the Saint of Rice Excrements) is that Hori argues that the self-mummification ritual emerged out of the practice of abstention from cereals (mokujiki-gyô). That is, the practice of not eating rice and subsisting only on fruits and nuts.
Abstention from cereals was considered an important training exercise for Shingon ascetics since a) it required a lot of willpower, and b) it was believed to give one superhuman powers. But of course, human nature being what it is, there were those on the no-cereal diet who cheated. Which leads us, finally, to the Saint of Rice Excrements. I'll let Ichiro Hori tell the rest of the story.