You could just enable or disable the cpu entirely depending on whether a cartridge had it or not.