Preserving muscle isn’t a big deal if you have fat stores, and do light excersize and even low weight lifting to keep what you have. The high HGH from fasting makes sure it’s pretty easy to keep your muscle. As far as burning fat, obviously the deeper fat burning comes after glucose is depleted, so anything after the first day is usually where that happens.
As far as building muscle size and strength, you want to fast to hit a boost to your HGH, lift hard, then refeed with protein. My method lately when I’m not in an extended fast is this: On eating days I do a 20:4 IF window, lift Monday, fast Tuesday, then lift Wednesday towards the end of fasting window around the 43 hour mark, eat dinner and my second meal with high protein, fast Thursday, then Friday is the same as Wednesday. This way two of my lifts come at the end of a fast with that big HGH boost, but I’m eating protein after so that my muscles can actually rebuild. Then I do my normal IF on the weekend.
That’s like asking what is the ideal running distance.
The ideal fast length is the one you enjoy doing the most. Even if there was a ‘better’ length it is more sustainable for you to run your own race.