I never understood why the p-38 wasn’t fitted with merlin’s, up armored and 4 20mm cannons. That would have been quite a ground support package in WWII.
There was an upgraded, upgunned version of the P-38 called the “Chain Lightning”, but iirc it didn’t work very well. The P-38 was, at the time itvwas designed, bleeding edge techology with very tight tolerances. Didn’t lend itself to upgrades very well.
Although the upgraded/optimized P-38 you hypothecize did exist, somewhat, in the P-61 Black Widow.