This sounds kind of stupid and not rockstar-like at all. Imho a rockstar is someone who has integrity. And the integer (lol) thing to do would have been to tell that CTO to go take a hike. It is not your responsibility to compensate for extraordinary stupidity nor to single handedly lift the weight of all your coworkers. You are making this agonizing system work in the first place.