As an example, the Nintendo Switch used I2C over a ~2m cable to communicate between the controller and nunchuck. Worked fine even in noisy household settings with wifi and microwaves and whatnot.
At work we've used sensors for data logging that communicate using I2C over distances more than 20 meters, using plain Cat5 cable.
A longer cable means more bus capacitance, which means with the same pullup resistor the signal rise time will be higher, which means you need to reduce the bus speed. A stronger pullup will reduce the rise time (allowing a higher bus speed), but each chip's driver has to be able to overpower the pullup too. If the pullup is too strong for the drivers, you end up being unable to send a zero.
In practice your cables can be quite long, you just have to run it at a lower speed. If you really want to push it, there's always transceivers like the PCA9615 which turn it into a differential bus.
https://learn.adafruit.com/adafruit-wii-nunchuck-breakout-ad...
https://www.latticesemi.com/what-is-serdes
Someone else mentioned the PCA9615 which looks like it'd to the job.