The post on Europe’s Sabarimala generated an interesting discussion on brahmacharya and what it takes for men to withstand temptation. On this topic Mahatma Gandhi wrote to Amrit Kaur in 1947
My meaning of brahmacharya is this:One who never has any lustful intention, who by constant attendance upon God has become proof against conscious or unconscious emissions, who is capable of lying naked with naked women, however beautiful they may be, without being in any manner whatsoever sexually excited. Such a person should be incapable of lying, incapable of intending or doing harm to a single man or woman in the whole world, is free from anger and malice and detached in the sense of the Bhagavadgita. Such a person is a full brahmachari. Brahmachari literally means a person who is making daily and steady progress towards God and whose every act is done in pursuance of that end and no other. [Collected Works of Mahatma Gandhi Online
In the same letter, Gandhiji mentioned that he has lain naked with women. He thought of brahmacharya as a strong purifying force and to convince himself that he had the strength to withstand temptation he did these experiments while going around India trying to calm pre-partition riots of early 1947.
Marco Polo who visited India in the 14th century writes about meeting yogis who distinguished themselves by their abstinence. They went naked, ate nothing green since they believed that plants also had souls and lived a harsh life. When a member of the sect died, the successor had to pass a test. Various maidens touched the yogi, “here and there.” If the yogi remained unaffected, he was considered pure and allowed to the serve the idols. But if he failed, he was driven away for the monks did not want to do anything with a man of self-indulgence.