the debt limit is statutory law, which is trumped by the Constitution which has a little known provision that relates to this issue. Section 4 of the 14th Amendment says, “The validity of the public debt of the United States…shall not be questioned.” This could easily justify the sort of extraordinary presidential action to avoid default that I am suggesting.
I find it puzzling that the debt limit isn't part of the budget or an appropriations bill or something. I would think that authorizing spending (which really means mandating spending) without the revenues to pay for it would explicitly or implicitly come with the authorization to borrow, with some discretion presumably available to the executive branch. And I don't see why "the Treasury shall borrow no more than $14 bajillion" should carry more legal weight than "the treasury shall spend X bajillion on Medicare and Y bajillion on defense and Q bajillion on tobacco subsidies and J bajillion on convincing people who already overestimate the risks of smoking not to smoke" (I think most tobacco subsidies have been eliminated, but it used to be a good example).