How to detect if a sensor is connected to a digital input

Connect your sensor to a 3-pin connector, connect the third pin through a resistor to the GND pin. Then you can use that third pin to detect whether there's a connection.

The internal pull-ups of the ESP are about the same value as those of the Arduino so no change there. It's a voltage divider so it's the ratio that matter rather than the actual voltage applied.