I'd throw an RC filter on the PWM output to stabilize it. Put the output frequency to pretty much as high as you can and there will be very little ripple in the DC output.
Exactly. The challenge is that the PWM signal must pass through an optical coupler, and high-speed ones are expensive. So there is a balance between managing ripple, cost, and pulse sampling rate. .