During dry fasting I don't have stools, but it all comes out afterward. As for during water fasting, why not try psyllium husks / powder? I think that would be healthier than Epsom Salts . You can take them in combination with Epsom Salts if it really won't come out though.
In any case if you do that, be sure to take in enough water. I have this fear that taking psyllium around a dry fast, the body would absorb all the water resulting in intestinal blockage... NOT good.
As for constipation in general, exclusively whole-food plant-based diet centered on grains, legumes, potatoes, yams, with generous amounts of vegetables and fruit added. Basically between what Greger and Fuhrman on the one hand and Esselstyn / McDougall on the other hand recommend.
I recommend to take that strictly until the problem resolves and then some at least.
Dairy and especially cheese are a no-no if you are constipated.
Amla powder is a powerful supplement. Maybe Triphala would be good for you. When I took it back in the day, it was too harsh for me, but I have rather the opposite problem.
A soup of dried fruit, soaked overnight and then boiled is recommended as a remedy for constipation and can be used as a fast-breaking meal. Maybe this could be helpful as a regular part of your diet.
Just what I think works, I'm no expert / doctor etc.