MCP23017 I2C Port Expander
You can easily add more GPIO connections for an ESP8266 using a port expander. This example demonstrates how to do that with a common I2C port expander.
If you need a faster connection, see MCP23S17 SPI Port Expander.
References
SoC support
esp32
esp32c2
esp32c3
esp32s2
esp32s3
esp8266
host
rp2040