In Treta Yuga and other yugas there were several powerful people who became powerful after doing tapasya. As per the scientists, you can live 10 days without eating and drinking. Meanwhile Gandhi ji has survived 21 days without drinking water and eating food. So how to do penance without dying ?
Your question basically here is: How to do penance now (in Kali Yuga) without dying?
Then the answer is it is not possible to do Tapasya now like it was used to be done in the earlier Yugas (specially in Satya Yuga).
Even in Treta Yuga, Tapasya was not the ideal way. Knowledge (Jnanam) was. Tapas was the suited way only for Satya Yuga. In Kali Yuga it is charity alone.
See the following verse from Manu Smriti:
1.86. In the Krita age the chief (virtue) is declared to be (the performance of) austerities, in the Treta (divine) knowledge, in the Dvapara (the performance of) sacrifices, in the Kali liberality alone
And, the reason why it is not possible because in Kali Yuga people depend on the food for their existence. So, fasting (without which Tapasya is not possible) is not suited for us specially if it's for many days.
In the Satya, Treta, and Dvapara Ages, the Mantras, O Kalika! were in their application preceded by the Pranava (9); but in the Kali Age, O Supreme Devi! the decree of Shangkara is that man do perform all rites with the aid of the same Mantras, but preceded by the Maya Vija (10). All Mantras in the Nigamas, Agamas, Tantras, Sanghitas and Vedas, have been spoken by Me. Their employment, however, varies according to the Ages (11). For the benefit of men of the Kali Age, men bereft of energy and dependent for existence on the food they eat, the Kula doctrine, O Auspicious One! is given (12)
Mahanirvana tantra's 9th chapter