It'd have to be a huge discount as they'd be buying the debt along with it. Why would someone want to saddle themselves with an unprofitable debt burden?
BofA/whoever lent $12B or whatever to Twitter/Elon. Ultimately they have to settle for lower payments or get Tesla stock or whatever, and the debt is cleared. Or it defaults. Either way, Twitter the service has no reason to shut down, and doesn't carry that debt further.
Once the debt cost is sunk, what matters is future marginal profitability.