Koepel is correct for simple wiring.
However, you can easily get 50 meters or more from specialized shielded cables provided you understand how electrical interference (hum, noise, EMP) creates problems.
If you are insistent on doing this switching, refer to XLR (analog) low-signal "balanced" cabling and take notes on shield wiring.
https://stampsound.com/how-long-can-xlr-cables-be/
The current being switched is low, so inductance will be no problem but capacitance will force an upper limit on how quickly the switch can cycle.
Honestly, opto-isolators are the ideal way to be safe in this scenario.