Politics at the national level have seldom been as bitterly partisan as they are now and the cost to the country is intolerably high. Economists have estimated that the recent (and totally unwarranted) shutdown of the federal government, a direct result of this extreme partisanship, cost the United States several billion dollars.

And, as The New York Times pointed out last week, “the affiliated damage — like the undermining of consumer and business confidence — will be far greater, economists said, especially combined with the financial effects of the near-breach of the country’s statutory debt ceiling.”

But it need not be that way in Washington, as California has proved. Once a state notorious for its bitter political battles, it now represents a model that other states should examine and, in the interest of good government, copy.

California simply got rid of the gerrymandering — the clumsy and often outrageous legislative shaping of political districts to practically guarantee one party or another success at the polls — and handed the responsibility for creating district boundaries to a nonpartisan commission.

This year’s is the first Legislature chosen under the new nonpartisan election system where the top-two finishers in a primary run against each other — without party affiliations — in a scheme carefully designed to encourage candidates to appeal to a less partisan segment of the electorate.

Also, California voters last year approved an initiative that softened the impact of the stringent term limits that had created a Legislature filled with inexperienced politicians who were inclined to be more interested in the next election than in anything else. The state’s lawmakers now can serve up to 12 years in either of the Legislature’s two houses.

Other states have learned that term limits, a concept particularly popular with voters who are predisposed to distrust their elected representatives, have in effect handed the levers of political power over to savvy lobbyists and to the bureaucracy, where term limits don’t apply.

Lately, California has celebrated several previously unlikely legislative successes as a parade of bill signings provided a sharp contrast between the federal shutdown in Washington and a virtually acrimony-free California Legislature enacting laws addressing school financing, immigration, gun control and abortion.

Granted, this is happening under what can only be called one-party rule, as Democrats now control both houses of the Legislature and the governorship. (As recently as three years ago it was the exact opposite, with Republicans in charge of everything.)

But the changes have not generated GOP efforts to stymie the Democratic majority, which has become standard operating procedure in Washington.

“You see Republicans voting for immigration reform, you see Democrats voting for streamlining environmental regulations,” Dan Schnur, the director of a political institute at the University of Southern California told The New York Times. “You never would have seen that before.”

Republican Sen. Anthony Canella recently co-sponsored a bill that allows unauthorized immigrants to obtain drivers’ licenses. Cannella’s district was 35 percent Republican when he was elected three years ago but that number now is only 14 percent under district lines drawn by the nonpartisan commission.

Cannella said the redistricting and nonpartisan election changes freed legislators from obedience to their party bases, giving “more courage to my Republican colleagues … now it’s not just their base they have to appeal to.”

We’d all benefit if similar reforms were adopted for congressional redistricting in all states. As long as state legislatures draw voting districts that give the majority party a guaranteed edge at the polls, we’ll continue to suffer the cost and embarrassment of a dysfunctional Congress. America can do better. America must do better.