Some Supreme Court justices on Wednesday seemed to think Minnesota’s law banning “political” clothing and buttons from polling places is an affront to free speech, while some seemed to think it might uphold the decorum and dignity due the casting of a ballot in a democracy.

But all came bearing hypotheticals. And for the two lawyers arguing the case, their time in the well of the Supreme Court came to resemble the time fish spend in a barrel.

At issue is a law that prohibits people from wearing a “political badge, political button or other political insignia” at a polling place on an election day. But the law has been broadly interpreted to bar logos of the National Rifle Association, AFL-CIO, MoveOn ­.org and, in the test that got the case to the high court, the tea party movement.

The justices had no trouble putting the lawyers on the spot by thinking up others that might violate Minnesota’s law: #MeToo, Make America Great Again, ­“Resist,” “Restrain Government Spending,” a Colin Kaepernick jersey, a Reagan/Bush ’84 shirt and wearing all white to signal solidarity with the suffragists.

Justice Samuel A. Alito Jr., a former prosecutor, mounted what felt like a cross-examination of Daniel Rogan of the Hennepin County Attorney’s Office, who was defending Minnesota’s law.

“How about a shirt with a rainbow flag?” asked Alito. “Would that be permitted?”

“A shirt with a rainbow flag?” Rogan repeated. “No, it would — yes, it would be — it would be permitted unless there was — unless there was an issue on the ballot that — that related somehow to — to gay rights.”

A T-shirt bearing the words of the Second Amendment? Alito asked.

Probably banned because of the gun-control issue, Rogan said.

The First Amendment? Alito asked. Probably not, Rogan answered.

That led Justice Neil M. Gorsuch to observe: “Under your interpretation of ‘political,’ it would forbid people from wearing certain portions of the Bill of Rights into a polling place but not other portions of the Bill of Rights. And I guess I’m just wondering what compelling interest Minnesota has identified that requires a statute that goes so much further than the vast majority of states?”

On the other hand — and there’s always another hand at the Supreme Court — some justices wondered why any voter had the need to express political views while casting a vote.

“Why should there be speech inside the election booth at all, or inside the what you call the election room?” Justice Anthony M. Kennedy asked J. David Breemer, a lawyer for the Pacific Legal Foundation, representing the challengers. “You’re there to vote.”

Justice Stephen G. Breyer added that after the “hurly-burly” of a campaign, couldn’t there be a “place where a person has reflective thought for a moment?”

Several criticized Breemer for not offering a clear view on whether a state could ban direct advocacy for a candidate in the polling place without violating the Constitution.

“I honestly don’t know, your honor,” Breemer said when Justice Elena Kagan posed that question. He added: “I agree it’s a tough — a very tough call, but it’s not one this court has to decide.”

That did not suit Kennedy. “It’s important for us if we’re going to have to write an opinion on this. You say, ‘Well, I don’t know, I don’t know.’”

The Supreme Court decided 25 years ago that states could ban electioneering and distributing campaign materials within 100 feet of polling places, and all states have restrictions.

But Minnesota and nine other states go further. Minnesota’s clothing and button ban has been interpreted to include the names of political parties, candidates, support or opposition to a ballot question; materials designed to influence voting; and the promotion of groups with recognizable political views, which is where unions, the chamber of commerce and other organizations come in.

On Election Day 2010, Andrew Cilek, executive director of the Minnesota Voters Alliance, was stopped at the polls for wearing a tea party T-shirt and a button saying “Please I.D. Me.” (The button issue has dropped out of the case, and Breemer acknowledged Wednesday that could be intimidating, since the state does not have an ID requirement.)

Cilek was told he could not vote without covering up or losing the T-shirt. Eventually, he was allowed to vote.

His name was recorded for possible prosecution — Alito called it being registered as a “bad Minnesotan” — but Rogan said no one has been prosecuted or fined for offending the law.

Indeed, he agreed with Kagan that the main work of the statute is that Minnesotans comply with it.

“For over 100 years, we’ve had this statute in place and . . . this is the first time that it’s been challenged by anybody,” Rogan said.

He turned the tables once on his inquisitors, nothing that “there are instances where you can ban any type of speech.”

For that, he said, the justices need look no farther than the plaza in front of the Supreme Court, “where any speech or any message on a banner, flag, or device is prohibited.”

The case is Minnesota Voters Alliance v. Mansky.