Diode in place of manual switch for HV application
These parts from VMI are typical of what is available, assuming we are talking about low power dissipation: https://www.voltagemultipliers.com/products/diodes/axial-lead-glass-body-diodes/  At 5 kV reverse voltage, it is not possible to avoid a few volts of forward drop when using semiconductor diodes. If you are interested in very low frequencies, then it is possible to use HV relays along with sensing electronics to control when they switch.