Well you've been crunching wrong, with no regard for inflation and investment returns. I'm not assuming some crazy rate of return here. I'm talking 5% (even index funds yield 6-7% so this is pretty conservative), with 3% inflation.
Let's say I make $10k a month after taxes. Let's assume I never make more than that for the rest of my career. Then $1k goes towards the loan, and I have $9k to live with. $2k towards mortgage and utilities, $4k for living and other expenses leaves me $3k to put away monthly. After 20 years, that's roughly $1.2 million put away assuming 5% annual return on my investments. 10 more years would put it well over 2 million.
With $400k borrowed at 7%, I pay about $220k plus about $280k in taxes for the forgiven amount for the total of $500k. The nominal cost is indeed high but pretty good compared to what I would've paid with the 10-year plan ($570k). At this point my mortgage is probably paid off and I have decent enough credit to take out a low-interest loan to pay off the tax bomb. If not I could just put away an extra $500/month for 20 years (would come out to $200k at 5% return) to prepare for it. As a last resort I could tap into my savings. There are many ways to do this.
Private refinancing at 4% would cost $500k over 10 years, pretty much the same as PAYE minus returns, plus costs of inflation.
All things considered, the NPV for the loan is $460k for 10-year standard, $400k for 10-year private at 4%, and $260k for REPAYE. Maybe not half, but pretty darn good.