Back to the original question:
Totemi1324 wrote: ↑
Thu Sep 05, 2019 5:02 pm
I read on the internet that the optimal cable length for GPIO-communication with standard jumper-wires are 20cm-30cm.
Where did you read that?
There're a couple of reasons for limiting the lengths of wires.
One is the voltage drop over a longer wire if if it's carrying a significant current - probably not applicable in your case, but the cause of much grief when someone is using cheap USB cables to supply a Pi
The second is electromagnetic interference (EMI) pick-up.
The longer a wire is, the more energy it can pick up from the environment, and the higher the impedance of the circuit, the less energy required to cause problems.
Depending on quite what you mean by "a logical voltage shifter", its output may be quite high impedance, but unless you have used your own pull-up or -down resistors, the input to the Pi is certainly high impedance, meaning that only small induced currents can cause high voltages to be seen by the Pi.
There are three ways to reduce the problem.
One - use shorter wires, not helpful in your case.
Two - reduce the impedance of the circuit, by putting a 1k or less pull-up or -down resistor close to the Pi
Three - use two-core shielded cable.