Something like a 74HC4066 or similar IC? More compact than a relay and lower power requirements, but will only tolerate small currents on through the switching element. These sort of analog switch ICs also won't cope with higher voltages (some types 5 volts, others might handle 12), but as your oscilloscope's core is an ESP I assume you aren't going to be measuring larger voltages with it?