I use ESP32s on mains detection circuits using nothing more than a potential divider to drop rectified 240V down to 3.3V. To protect the pins, I add BAT54 diodes between the divider junction and the ESP32 3.3V supply and a 10K resistor in series with the GPIO input pin. The diode prevents the voltage rising above about 3.7V, even if the mains voltage rises well above normal and the series resistor limits the current that can flow into the pin.
The high impedance of the divider prevents very fast operation but if you are working with lower voltages the values would be lower and speed faster. If you want to use Zener clamps, I would suggest using 2.7V diodes and a series resistor from the source. My tests show the logic threshold on ESP inputs is almost exactly half VDD so anything above about 1.6V will be seen as a logic high.
You may have to factor in the internal pull-up and pull-down resistors on some ESP32 modules, typically the reset line and GPIO0 pins have pull-ups and I think it's GPIO2 has a pull-down. Other inputs are very high impedance.
Brian.