Wikipedia has different articles in English and German about hunger strikes. The English version talks about people dying after 52 to 74 days of strike and it looks as if it is the lower bound. One Person, Swami Nigamanand, is reported to have died after being on a hunger strike for 115 days. There are several other numbers in between, and not every incident ended in the death of the hunger strike performer.
The German Wikipedia talks about 50 to 70 days strikes, which can be survived, but this sounds like an upper bound. The article is much shorter and concentrates on well known cases in Germany.
But there is a link to the medical aspects of hunger strike and a english version too. To summarize them: In the beginning, a typical weight loss is about 1kg/day, later 0.5kg/day.
Normally, a person will die without water after 3-4 days, but depending on weather circumstances, this can be shorter (1d, hot, dry) or longer (10d, cold, wet). Without food, but with water, healthy persons should survive 30 to 200 days. A critical question is, whether you get minerals and vitamins, or not even that.
One kg of body fat can be used like 30 MJoule or 7.000 kcal energie.
Afaik, we don't know much about the kind of diet which Moses or Jesus would have performed, and in which physical condition they started. Did they drink, and if they did, just water, milk or juice? If I remember correctly, the Bible claims that John Baptist ate locusts, which have a lot of proteins; did Jesus too?
My conclusion from this information is, that - apart from being just a written story - a 40 day fastening is hard, but possible - not a miracle, but a stunt of discipline. But 40 days without water is impossible; that's a lie.