Both presidential candidates stepped off the campaign trail Tuesday, and something funny happened.

They gave serious and substantive speeches about foreign policy that were not dominated by gaffes, gotcha moments or focus-group-tested applause lines.

Both articulated different but complementary visions for America’s role in the world, suggesting the possibility of a bipartisan consensus on foreign policy the likes of which has not been seen since the days after the 9/11 attacks.

Watching them back to back gave a glimpse about what government could be like if mindless partisanship didn’t get in the way.

President Barack Obama’s address to the UN General Assembly addressed the concept of free speech, its importance in American life and its rightful place in the post-authoritarian regimes in the Arab world.

True democracy, Obama said, is a system where no one should be thrown into jail for his beliefs. That’s is why America tolerated the making of an Islamaphobic feature film no matter how offensive it is to Americans of all faiths, and why the fledgling democracies in the Middle East should tolerate the views of dissidents and minorities.

When those words turn to violence, however, it is the government’s role to stop the kinds of protests that have roiled through Egypt, Pakistan and Libya, regardless of how offensive the speech that provoked them had been. True democracy, he said, is hard work.

The antidote for offensive speech, Obama said, is more speech, and the governments should condemn any argument that goes too far, whether it’s blasphemy against Islam or denial of the Holocaust — a common form of hate speech in the Arab world.

“But in 2012, at a time when anyone with a cellphone can spread offensive views around the world with the click of a button, the notion that we can control the flow of information is obsolete. The question, then, is how do we respond?”

These are not American values that the United States is trying to impose on the world, he said, but universal ones that America will work to promote with all willing partners. It was a powerful message of engagement.

So was Mitt Romney’s, made to international development activists at the Clinton Global Initiative meeting in New York.

Romney spoke about foreign aid, but not in the cartoonish threatening way it’s usually portrayed in our politics.

He talked about the dignity of work and power of economic liberty. Free enterprise, he said, “has done more to bless humanity than any other economic system,” because of the way it empowers an individual to build a life.

Foreign aid can be misspent. It can be lost to corruption. It can sustain some people for some time, but it cannot build an economy. Government aid efforts that work in partnership with business and philanthropic groups have the best chance of building something that can last.

And, Romney said, the benefits are not only monetary. The countries with the most economic liberty and respect for individual rights also are the most free.

“Free enterprise cannot only make us better off financially, it can make us better people,” Romney said.

In delivering his remarks, Romney looked very much like the competent CEO/candidate that has been missing from some frantic recent events on the campaign trail.

Without pounding the podium, he delivered a clear message of how he wanted America to interact with the world, which was not unlike Obama’s vision, although the two candidates stress different values.

With six weeks left to go in the campaign, it’s a shame that this may be the last time before the election that we see either of these candidates exchanging views in such a dignified and enlightening manner.

Our political system demands that these campaigns are fought out through sound-bites and attack ads, with even the head-to-head “debates” looking like carefully scripted exchanges of talking points aimed at tiny slices of the few remaining undecided voters in key precincts of battleground states.

Thanks to Internet video-sharing services such as YouTube, both speeches are still available online.

If you want to know about the men who are running for president, both speeches are worth watching.