LM2596, Voltage divider causes delay in voltage changes
The problem is that you are using your voltage divider also as the "bleed" resistor for your output filter capacitor. When you stop the regulator from operating, this capacitor needs to be discharged, and that takes time.

To make it happen faster, you either need to switch to a smaller capacitor, or you need to provide a separate path for that discharge current.



Or, as I said in a comment, it might be better to block the current rather than shorting it out. As long as it's inside the feedback loop, it won't materially affect output regulation. For example, use a PNP transistor fed by a current sink:







simulate this circuit &ndash; Schematic created using CircuitLab

Q1 needs to be rated for the maximum voltage and current of the power supply.

Q2 needs to be rated for the maximum voltage, and it needs to sink enough current to keep Q1 saturated when on.

Select R2 based on the control logic voltage and the current required for Q1.