If you die with $100m of stock and $10m in loans, you pay estate taxes on $90m of net assets and $0 of capital gains (your heirs get a step-up in basis on death). If you die with $90m of stock because you sold $10m of it for consumption, you pay the same estate taxes and additional capital gains on the sale.
In short, the estate pays off the loans by selling stock immediately after death.
In short, the estate pays off the loans by selling stock immediately after death.