Voltage surge suppression technique in high-speed switching based electronic circuit
Have you tried something like this configuration:
When S1 is bypassing L1, SW3 is closed.
When S1 is in series with L1, SW3 is open.



simulate this circuit &ndash; Schematic created using CircuitLab
It should quickly quelch any energy in the inductor, and keep it local to that loop.