Arduino MEGA 2560 With WiFi Built-in

I have previously used this board with no problems at all with serial communication between the arduino and the esp8266.

however this time i want to try something different, i am wanting to connect with the i2c protocol between gpio 4 and 5 on the esp8266 (which i believe are exposed on the header pins) and pin 20 and 21 on the mega.

this is purely so that i can use the Arduino as a port expander for the esp8266.

I really have two questions, the esp8266 is 3.3v and the arduino pin out is 5v so i am assuming i will need a logit shifter to isolate the two voltages (or is there a better way) and has anybody previously tried this?

many thanks in advance.

the esp8266 Wire library is a software implementation and can be used on any pair of suitable pins.
I don't use level shifting between ATmega and esp8266 for any type of serial communication (Serial, SPI, I2C), but many furom members disagree with my opinion on 5 V tolerance of esp8266 pins for low current logic levels.

why I2C? why not Serial wired on board?
there is a library for simple control of ATmega pins from esp8266 over Serial. GitHub - gmag11/FirmataMaster: Firmata client (master) library for ESP8266 (or any other Arduino compatible board)

Thanks Juraj,

its because i was being lazy and hoping to use this