Ah, July! What a great month for those of us who celebrate American exceptionalism. There’s the lead-up to the Fourth, countrywide Independence Day celebrations including my town’s local Revolutionary War reenactment and fireworks, the enjoyable days of high summer, and, for the fortunate, the prospect of some time at the beach.

Sorry, but this year, July isn’t going to work for me. That’s because of a new kind of American corporate exceptionalism: companies that have deserted our country to avoid paying taxes but expect to keep receiving the full benefits that being American confers, and for which everyone else is paying.

Yes, leaving the country — a process that tax-techies call inversion — is perfectly legal. A company does this by reincorporating in a place such as Ireland, where the corporate tax rate is 12.5 percent, compared with 35 percent in the United States. Inversion also makes it easier to divert what would normally be U.S. earnings to foreign, lower-tax locales. But being legal isn’t the same as being right. If a few companies invert, it’s irritating but no big deal for our society. But mass inversion is a whole other thing, and that’s where we’re heading.

We’ve also got a second, related problem, which I call the “never-heres.” They include formerly private companies such as Accenture, a consulting firm that was spun off from Arthur Andersen, and disc-drive maker Seagate, which began as a U.S. company, went private in a 2000 buyout and was moved to the Cayman Islands, went public in 2002, then moved to Ireland from the Caymans in 2010. Such firms can duck lots of U.S. taxes without being accused of having deserted our country because, technically, they were never here. So far, by Fortune’s count, some 60 U.S. companies have chosen the never-here or the inversion route, and others are lining up to leave.

All of this threatens to undermine our tax base, with projected losses in the billions. It also threatens to undermine the American public’s already shrinking respect for big corporations.

Inverters, of course, have a different view of things. It goes something like this: The U.S. tax rate is too high and uncompetitive. Unlike many other countries, the U.S. taxes all profits worldwide, not just those earned here. A domicile abroad can offer a more competitive corporate tax rate. Fiduciary duty to shareholders requires that companies maximize returns.

My answer: Fight to fix the tax code, but don’t desert the country. And I define “fiduciary duty” as the obligation to produce the best long-term results for shareholders, not “get the stock price up today.” Undermining the finances of the federal government by inverting helps undermine our economy. And that’s a bad thing, in the long run, for companies that do business in the United States.

Finally, there’s reputational risk. I wouldn’t be surprised to see someone in Washington call public hearings and ask chief executives of inverters and would-be inverters why they think it’s okay for them to remain U.S. citizens while their companies renounce citizenship. Imagine the reaction. And the punitive legislation it could spark.

Companies that have gone the inversion or never-here route but that act American include household names such as Garmin, Michael Kors, Carnival and Nielsen. Pfizer, the giant pharmaceutical company, tried to invert this spring, but the deal fell through. Medtronic, the big medical-device company, is trying to invert, of which more later. Walgreens is talking about inverting, too — it’s easier to boost earnings by playing tax games than by fixing the way you run your stores.

Then there’s the “Can you believe this?” factor. Carnival, a Panama-based company with headquarters in Miami, was happy to have the U.S. Coast Guard, for which it doesn’t pay its fair share, help rescue its burning Carnival Triumph. (It later reimbursed Uncle Sam.) Alexander Cutler, chief executive of Eaton, a Cleveland company that he inverted to Ireland, told the City Club of Cleveland, without a trace of irony, that to fix our nation’s budget problems, we need to close “those loopholes in the tax system.” Inversions, I guess, aren’t loopholes.

Before we proceed, a brief confessional rant: This spectacle makes me deeply angry. It’s the same way that I felt when idiots and incompetents in Washington brought us to the brink of defaulting on our national debt in summer 2011, the last time that I wrote anything angry at remotely this length. Except that this is worse.

Inverters don’t hesitate to take advantage of the great things that make America America: our deep financial markets, our democracy and rule of law, our military might, our intellectual and physical infrastructure, our national research programs, all the terrific places our country offers for employees and their families to live. But inverters do hesitate — totally — when it’s time to ante up their fair share of financial support of our system.

Inverting a company, which is done in the name of “shareholder value” — a euphemism for a higher stock price — is way more offensive to me than even the most disgusting (albeit not illegal) tax games that companies such as Apple and GE play to siphon earnings out of the nation. At least those companies remain American. It may be for technical reasons that I won’t bore you with — but I don’t care. What matters is the result. Apple and GE remain American. Inverters are deserters.

Even though I understand inversion intellectually, I have trouble dealing with it emotionally. Maybe it’s because of my background: I’m the grandson of immigrants, and I’m profoundly grateful that this country took my family in. Watching companies walk out just to cut their taxes turns my stomach.

Okay, rant over.

The current poster child for inversion outrage is Medtronic, the multinational Minnesota medical-device company that once exuded a cleaner-than-clean image but now proposes to move its nominal headquarters to Ireland by paying a fat premium price to buy Covidien, itself a faux-Irish firm that is run from Massachusetts except for income-tax-paying purposes. For that, it is based in Dublin. That’s where the new Medtronic PLC would be based, while its real headquarters would remain on Medtronic Parkway in Minneapolis. Of course, the company is unlikely to return any of the $484 million worth of contracts the federal government says it has awarded Medtronic over the past five years.

If the Medtronic deal goes through, which seems likely, it will open the floodgates. Congress could close them, as we’ll see — but that would require our representatives and senators to get their act together. Good luck with that.

Now let’s have a look at some of the more interesting aspects of the proposed Medtronic-Covidien marriage.

Medtronic is one of those U.S. companies with a ton of cash offshore: something like $14 billion. That’s money on which U.S. income tax hasn’t been paid. Medtronic told me it would have to pay $3.5 billion to $4.2 billion to the IRS if it brought that money into the United States: That’s the difference between the 35 percent U.S. tax rate and the 5 to 10 percent it has paid to other countries. Among other things, inverting would let Medtronic use offshore cash to pay dividends without subjecting the money to U.S. corporate tax.

I especially love a little-noticed multimillion-dollar goody that Medtronic is giving its board members and top executives. Years ago, to discourage inversions, Congress imposed a 15 percent excise tax on the value of options and restricted stock owned by top officers and board members of inverting companies. Guess what? Medtronic says it’s going to give the affected people enough money to pay the tax.

We’re talking major money — major money that I’m glad to say isn’t tax-deductible to Medtronic. The company wouldn’t tell me how much this would cost its stockholders. So I did my own back-of-the-envelope math, starting with chief executive Omar Ishrak.

Using numbers from Medtronic’s 2014 proxy statement and adjusting for its stock price when I was writing this, I figure that his options and restricted shares are worth at least $40 million, and the “equity incentive plan awards” that he might get are worth another $23 million. Allow for the fact that Medtronic will “gross up” Ishrak, et al., by giving them enough money to cover both the excise tax and the tax due on their excise tax subsidy, and you end up with $7.1 million to $11.2 million just for Ishrak. And something more than $60 million for Medtronic as a whole.

Why does Medtronic feel the need to shell out this money? The company’s answer: “Medtronic has agreed to indemnify directors and executive officers for such excise tax because they should not be discouraged from taking actions that they believe are in the best interests of Medtronic and its shareholders.”

But you know what, folks? These people are fiduciaries, who are legally required to put shareholders’ interests ahead of their own. If they believe that inverting is the right thing to do (which, it should be obvious by now, I don’t) they ought to pay any expenses they incur out of their own pockets, not the shareholders’. It’s not as if these people lack the means to pay — the directors get $220,000 a year (and up) in cash and stock for a part-time job, and Ishrak gets a typical hefty chief executive package.

One more thing: Normally, a company’s shareholders don’t have to pay capital gains tax if their firm makes an acquisition. But because this is an inversion, Medtronic shareholders will be treated as if they’ve sold their shares and will owe taxes on their gains. However, the deal won’t give them any cash with which to pay the tab.

The company asked me to mention that its executives and directors, like other holders, will be subject to gains tax on shares that they own outright, and Medtronic won’t compensate them for it. Okay, consider it mentioned.

Second, the company contends that this deal will be so good for shareholders that it will more than offset their tax cost triggered by the board’s decision to invert. Well, we’ll see.

A major barrier to inversion used to be that companies moving offshore were kicked out of the Standard & Poor’s 500-stock index. Given that more than 10 percent (by my estimate) of the S&P 500 stocks are owned by indexers, getting tossed out of the index — or being added to it — makes a big, short-term difference in share price. In 2008 and 2009, S&P, which has a few never-heres, tossed nine companies off the 500 for inverting. But four years ago, S&P changed course, for business reasons. Companies were angry at being excluded, and index investors wanted to own some of the excluded companies. Moreover, S&P feared that a competitor would set up a more inclusive, rival index.

So in June 2010, S&P changed its definition of American.

Now all it takes to be in the S&P 500 is to trade on a U.S. market, be considered a U.S. filer by the Securities and Exchange Commission, and have a plurality of business and/or assets in the United States.

The result: S&P now has 28 non-American companies in the 500.

How much money are we talking about inverters sucking out of the U.S. Treasury? There’s no number available for the tax revenue losses caused by inverters and never-heres so far. But it’s clearly in the billions. Congress’s Joint Committee on Taxation projects that failing to limit inversions will cost the Treasury an additional $19.5 billion over 10 years — a number that seems way low, given the looming stampede. But even $19.5 billion — $2 billion a year — is a lot, if you look at it the right way. It’s enough to cover what Uncle Sam spends on programs to help homeless veterans and to conduct research to create better prosthetic arms and legs for our wounded warriors.

Rep. Sander M. Levin (D-Mich.) and his brother, Sen. Carl Levin (D-Mich.), have introduced legislation that would stop Medtronic in its tracks by making inversions harder. Under current law, adopted in 2004 as an inversion stopper, a U.S. company can invert only if it is doing significant business in its new domicile and shareholders of the foreign company it buys to do the inversion own at least 20 percent of the combined firm.

The Levins propose to require that foreign-firm shareholders own at least 50 percent of the combined company for it to be able to invert and also that the company’s management change. This would really slow inversions — but the chances of Congress passing the Levin legislation are somewhere between slim and none.

Conventional wisdom holds that companies are inverting now because they’ve despaired of getting clean-cut reform that would widen the tax base and lower rates. But John Buckley, former chief Democratic tax counsel for the House Ways and Means Committee, has a different view. Buckley thinks that we’re seeing an inversion wave not because there’s no prospect of tax reform but because there is a prospect of reform. If reform comes, he says, there will be winners and losers — and it’s the likely losers-to-be that are inverting. “Even minimal tax reform would hurt a lot of these companies badly,” he says.

For example, Buckley says, a company that inverts before reform takes effect will be able to suck income out of the United States to lower-tax locales much more easily than if it were still a U.S. company. “A revenue-neutral tax reform requires there to be winners and losers,” Buckley says. “But by inverting, the companies that would be losers are taking themselves out of the equation . . . They’re taking advantage of both U.S. individual taxpayers and other corporations.”

If you’re a typical chief executive who has read this far, about now you’re shaking your head and thinking, “What a jerk! Just cut my tax rate and I’ll stay.” To which I say, “I wouldn’t bet on it.”

In the widely hailed 1986 tax reform act, Congress cut the corporate rate to 34 percent (now 35 percent) from 46 percent and closed some loopholes. Corporate America was happy — for a while. Now, with Ireland at 12.5 percent and Britain at 20 percent (or less, if you make a deal), 35 percent is intolerable. Let’s say we cut the rate to 25 percent, the wished-for number I hear bandied about. Other countries are lower, and could go lower still to lure our companies. Is corporate America willing to pay any corporate rate above zero? I wonder.

So what do we need? I’ll offer you a bipartisan solution — no, I’m not kidding. For starters, we need to tighten inversion rules as proposed by Sander and Carl Levin, who are both big-time Democrats. That would buy time to build a more rational corporate tax structure than we have now — bolstered, I hope, by input from tough-minded tax techies.

We also need loophole tighteners along the lines of proposals in the Republican-sponsored, dead-on-arrival Tax Reform Act of 2014. One part would have imposed a tax of 8.75 percent a year on cash and cash equivalents held offshore and 3.5 percent a year on other retained offshore earnings.

Another thing we need to do — which the SEC or the Financial Accounting Standards Board could do in a heartbeat but won’t — is require publicly traded U.S. companies and U.S. subsidiaries of publicly traded foreign companies to disclose two numbers from the tax returns they file with the IRS: their U.S. taxable income for a given year and how much income tax they owed. This would take perhaps one person-hour a year per company.

That way we would know what firms actually pay instead of having to guess at it. Then we could compare and contrast companies’ income tax payments.

What we don’t need is another one-time “tax holiday,” like the one proposed by Sen. Harry M. Reid (D-Nev.), to let companies pay 9.5 percent rather than 35 percent to bring earnings held offshore back home. It would be the second time in a decade we’ve done that, and it would signal to tax avoiders that they should keep sending tons of money offshore, then wait for a tax holiday — presumably not on Independence Day — to bring it back.

Until — and unless — we somehow get our act together on corporate tax reform, companies will keep leaving our country. Those that try to do the right thing and act like good American corporate citizens will come under increasing pressure to invert, if only to fend off possible attacks by corporate pirates — I’m sorry, “activist investors” — who see inversion as a way to get a quick uptick in their targets’ stock price.

Now, two brief rays of sunshine: one in Britain, one here.

Starbucks, embarrassed by a 2012 Reuters exposé showing that it paid little or no taxes in Britain despite telling shareholders it made big profits there, has recently apologized and now makes substantial British tax payments. And eBay, God bless it, decided to bring $9 billion of offshore cash into the United States and pay taxes on it.

So I’m feeling a bit better about July than when I started writing this. In any event, a happy summer to you and yours.

Sloan is Fortune magazine’s senior editor at large. Additional reporting: Marty Jones, Mehboob Jeelani, Phil Wahba and Michael Casey.