I am currently going through an interesting situation where I have two MCUs (Let's call them A and B) in my design. One of the MCUs (A) is always powered on and another MCU(B) is powered through a regulator whose enable pin is controlled by the first MCU. There are many GPIOs connected between these two MCUs. And some peripherals and ADC feedbacks are connected to MCU B.
Now the situation is that I have to put MCU B in power down mode in my application for some time and during that time MCU A will be functioning normally. I checked that if I don't give any power to MCU B then it gets powered up due to GPIOs connected to it. And I am afraid that MCU B can damage the code of MCU A or self-code or other peripherals because it's powered on when it is supposed to be off. The following block diagram explains the situation better:
One possible solution that comes to mind: putting a buffer for all connections of MCU B and powering that buffer IC through MCU B's power pin so it will be disabled and can disconnect the pins when MCU B is off.