glittergalaze
No idea how long to fast the endo away, everyone's body is different and I haven't had experience with endo, but here is the experience I did have that may be relevant to you.
I did a 33-day
Water Fast 3 years ago. I am female, so I got my period sometime after day 20, I do not remember exactly when. This period continued around 10 days when usually my period continues 4. It took a long time for the uterus lining to heal and blood kept drizzling.
Your surgery situation is similar in that your body will have to repair tissue damage. Repairing the tissue damage and recovering from the blood lost during the surgery will take longer. I am not sure if it will be safe and how long it will take because my experience and knowledge simply don't stretch that far.
Also, any and all possible drugs hit you harder and clear out faster when you haven't eaten. It is possible that you fasting may impact the appropriate anaesthesia dosage so even though your doctor is likely to disapprove of you fasting (mainstream doctors usually do), I second the suggestion that you have to tell your doctor about the fast.
The doctor will most probably advise you to terminate the fast regardless of whether it is necessary because if he doesn't and something happens it can be seen as malpractice so he has to cover his ass.
Even so, you can always refeed for a couple of months then fast again :)