There was no law to require the TARP bailout. None whatsoever. The fact that Hank Paulson had to go on his knees before Nancy Pelosi to get it passed is testament to that fact.
All GWB had to do was to say clearly in 2005-6 that there would be no injection of Federal money to rescue balance sheets from exposure to shaky mortgages, and that banks who bought those mortgages (there is and was no law requiring them to do so) from the originating lenders did so entirely at their own risk.
The problem is the feds forced banks to make those loans. And there were laws passed by the Democrats for the last 30 yrs essentially forcing them.