“That’s a pretty savvy planning technique because you can borrow forever and, if you do it right, you can extract value that’s not taxable to you,” Shaver said. “There’s an interest charge on it, but that’s cheaper than the tax rate.”

In the past month, Musk has unloaded almost $10 billion of Tesla stock after an unusual Twitter poll asking if he should sell part of his stake. He would typically pay a 23.8% rate that applies to long-term capital gains. That applies not on the entire amount, but instead only on the gain on shares since he acquired them.

Some of the shares being sold are the result of the exercise of options, and have no capital gains component.

But he’s sold about 5.4 million of shares that he already owned. Since Tesla’s stock price is up more than 1,500% in the last two years—and far, far more since the company was founded in 2003—that means he’ll owe 23.8% on nearly the entire sale price of those shares.

That would come to at least $1.35 billion based on $5.8 billion of shares sold so far.  If Musk sells a full 10% of his stake excluding the options, the total tax due could increase to about $4.35 billion, based on Tesla's current share price. The total could be slightly lower if Musk sells shares with a higher cost basis.

California would ordinarily tack an extra 13.3% on his bill. That would amount to $2.4 billion—if Musk hadn’t exited the state. The fact that the vast amount of Tesla’s gains occurred while he was a resident aren’t relevant.

It’s a “blind spot in the tax system,” said Cristobal Young, a Cornell University sociology professor who studies taxes on the rich.

Musk is “basically shirking his tax responsibilities,” Young said. “California provided access to the talent he needed to build the company.”

Governor Gavin Newsom has also touted California’s role in Musk’s ascension, saying that its history of innovation and policies promoting clean energy paved the way for Tesla to become the behemoth it is today.  A spokesperson for the state's Franchise Tax Board, which oversees tax collections, declined to comment, saying the law prohibits it from disclosing confidential information about individual taxpayers.

Escaping California’s taxes isn’t as simple as hopping on a private jet. The rules take into account a variety of criteria: Taxpayers need to show they’re actually cutting ties to the state, while physically relocating themselves and demonstrating they intend to “remain in the new locality permanently or indefinitely,” according to the tax board.

“That’s a complex analysis,” said Christopher Manes, an attorney in Palm Springs who specializes in California tax residency issues. “If he’s claiming he’s a nonresident, obviously California has an incentive to audit him and find out.”

A key issue is the length of time between an official move date and when a large transaction occurs. Taxpayers are generally advised to wait six months to a year, or risk facing California’s auditors.