Microcontrollers - disconnect I2C and Serial lines after loading from EEPROM
Here is my suggestion (hope it makes sense):

We have a quad 2-to-1 multiplexer to toggle the signals, as you suggested. A RS latch is used to decide the routing of the multiplexers. On MCU reset, the latch output routes the signals to the "startup" destination (plug/EEPROM). Now, the trick would be to use a fifth port of the MCU to switch from the startup state to the normal state, as soon as your program starts.







simulate this circuit &ndash; Schematic created using CircuitLab

Of course, you'll say: "but then one of my port is dedicated to this task, so I can't use it anymore! I want to be able to use all my ports!" (yes, you'll say that, I can even hear you from where I am).

Well, the thing is, once you are in the normal state, this signal has no effect anymore on the latch (until it is reset, of course). So you can actually use it for anything else at this point. The only drawback is that this signal will be toggled from high to low at startup (you can toggle it back high after). I'm sure you can find a signal in your application that can tolerate this behavior (a LED output, or anything not critical).