I'm not an expert on fasting by any means, but I don't set any specific number of days to fast and mostly listen to what my body is telling me which let's me know when it's time to break the fast. I also check and monitor my BP and weight daily.
I think most healthy people can easily fast for up to 14 days with few problems or risks, but beyond that you may be more susceptible to complications without careful monitoring by someone with experience or a doctor....very simple. I'd never attempt a 30-40 day fast on my own without supervision.
I'm on day #9 of my current fast and have had no issues and hope to go 14 days unless my body tells me to break the fast before then. In my opinion, taking chemical prescription drugs to treat any health condition has way more associated complication risks than fasting ever will. However some people can not fast either out of fear, lack of determination and willpower , current medical conditions, or other reasons.