With Bush v. Gore, the Supreme Court took on the outcome of one election. But the case heard by the Supreme Court on Monday could affect elections for many years.

The justices’ remarks during arguments in Friedrichs v. California Teachers Association point to a major setback looming for public unions. The court will likely rule teachers and other unionized public workers don’t have to pay their unions for representation unless they want to.

That means unions will have much less money to spend tilting elections for Democrats. Not only in California, but also in 22 other states where public workers are forced to support the union whether they want to or not. It’s a political earthquake for New York, New Jersey and Connecticut — where unions dominate public employment and politics.

In this case, Rebecca Friedrichs and nine other California public school teachers don’t want to support the California Teachers Association, because they oppose its views on tenure, lavish pension benefits and other goodies they say their communities can’t afford. They argue that being forced to support a union against their beliefs just to keep their jobs violates their First Amendment rights. A majority of the justices appeared receptive.

Justice Anthony Kennedy, often a swing vote, seemed to side with the teachers. The union, he said, espouses principles “that some teachers strongly object to.” Chief Justice John Roberts, hard to predict, agreed the issue is “whether or not individuals can be compelled to support political views that they disagree with.”

The wild card is Justice Antonin Scalia, who previously has supported mandatory public-union dues. But on Monday, Scalia wondered how it could be “OK to force somebody to contribute to a cause he doesn’t believe in.”

Kennedy, Roberts and Scalia, plus two justices known to oppose mandatory support for unions — Clarence Thomas and Samuel Alito — provide five votes to close the spigot of coerced union dues and fees. How much money is at stake? A Buffalo teacher who decided not to join the union could save $917 a year in take-home pay.

For some unions, the losses could be in the hundreds of millions of dollars — as much as 50 percent of what they currently rake in.

History proves it. When New York City’s Transport Workers Union had its mandatory dues-collecting suspended by the courts after an illegal 2005 strike, half its members stopped paying.

What’s bad news for the unions could be good news for John Q. Taxpayer. Unions have been major players in state and local politics, almost always on the side of big-spending Democrats.

Here in New York state, an astounding 72 percent of public workers are unionized — the highest such share in the nation.

Their leaders have a chokehold on politics. The teachers unions are “the key reason why our school spending, at nearly $20,000 per pupil, is highest in the country and roughly 85 percent above the national average,” says Empire Center President E.J. McMahon.

Public-sector unions in New York and many other states have pushed wages and benefits higher than what comparable private-sector jobs pay and demanded work rules that inhibit efficiency. The result is a massively inflated cost of government, borne by taxpayers.

With less money to spend after the Friedrichs ruling, unions will have less influence on state lawmakers and budgets.

Oh, sweet relief! It’s the average Joe, not the millionaires, who gets clobbered by the over-the-top spending compelled by unions.

Democratic politicians in New York are so committed to the costly, pro-union status quo that Attorney General Eric Schneiderman and New York City’s corporation counsel, who are supposed to work for all the people of the state, filed briefs in this case defending mandatory public-union payments.

They’re in the pocket of the unions — here and in many other states. Thankfully, that may change if the Supreme Court rules in favor of workers’ rights — and taxpayers.

Betsy McCaughey is a senior fellow at the London Center for Policy Research.