Gov. Scott Walker of Wisconsin is so ferociously dedicated to the right to bear arms that he recently signed a bill to allow babies to carry firearms.

Yet Governor Walker has also restricted access to guns for one group of Wisconsin residents. Saying that he wanted his state to “do better in protecting the victims, and potential victims, of domestic abuse,” he signed legislation three years ago requiring people placed under restraining orders to be notified that they must turn in any guns they own within 48 hours or face arrest. The law also spelled out how to confiscate weapons.

Mr. Walker was almost certainly saving lives: States that collect guns from people under restraining orders have a 22 percent lower rate of intimate-partner homicide by gun than those that don’t, according to a Michigan State University study released last month. And murders of bystanders — often police officers, children or other family members — commonly stem from these homicides. Twenty percent of the people killed in homicides related to domestic violence are not themselves intimate partners of the murderers, according to one 2014 study.

Yet Wisconsin is one of only 17 states, plus Washington, D.C., that have enacted this common-sense measure. This gap in public safety could be easily filled by the federal government. But that would require leaders of Congress to put aside their fear that any restrictions on guns — even those, like this one, that are endorsed by police organizations — will run afoul of the mindless absolutism that increasingly defines the National Rifle Association. Even strong advocates for gun rights should recognize how sensible it is to keep guns out of the hands of people who’ve been found to pose a danger.

Legislators in Wisconsin certainly understood that. Both state chambers backed the gun-relinquishment bill with bipartisan support; the gun lobby, after some back-room negotiations, chose not to weigh in.

“When people are in a situation where they are supposed to turn their guns in, we will make sure it’s done,” Garey Bies, the bill’s Republican sponsor and a former chief deputy sheriff, told The Milwaukee Journal Sentinel. “That way, if something arises, they won’t have easy access to a weapon. They will have to work harder to find one, and maybe by then they will have calmed down a little bit. That’s the goal: to take away the heat-of-passion-type situations.”

Mr. Bies’s position makes sense: All reputable research shows that the days right after a breakup are the most dangerous for victims of family violence, as an abuser feels his control slipping away.

Given all that’s known about the connection between family violence and mass shootings, if Congress wants to make American families safer, it will toughen federal law to require those convicted of domestic violence or stalking, or under a restraining order, to turn over their firearms. It’s simply wrong to think that red-state voters won’t back protections for victims of domestic violence: Gun-relinquishment laws have been enacted with broad support in rural, conservative states like North Dakota and Tennessee, along with swing states like Pennsylvania and Colorado. Pragmatic lawmakers on both sides of the aisle — senators such as Ron Johnson of Wisconsin, Patty Murray of Washington, Bob Corker of Tennessee and Richard Burr of North Carolina, all of whom represent states that already have such laws — should work together to champion it.

To build confidence in a national law, and to avoid constitutional questions, any legislation must address the Fifth Amendment stipulation that no person “shall be compelled in any criminal case to be a witness against himself.” California provides a model. Its law allows someone who has firearms illegally to turn them over, without fear of arrest for illegal gun possession, when he faces a protective order.

It’s imperative, too, that any federal law not repeat mistakes contained in some local laws. For instance, relinquishment ought to occur within 48 hours of its being ordered, not the 30 days that is sometimes required, which gives abusers too much time. Also, allowing guns to be handed over to either law enforcement agencies or a designated third party, such as a gun dealer or a bank, for safekeeping can improve compliance.

More challenges, though, lie with enforcement, not legislation. In many states, the question of whether to take guns from an abuser is left to the judge in each case. That can lead to uneven results, depending on judges’ political views or training. In Colorado, where judicial discretion holds sway, an analysis by The Denver Post found that in certain counties judges confiscated guns in 70 percent of cases, but that in neighboring counties other judges did so in less than 1 percent of cases. In Dallas County in Texas, a recent analysis found similar variance.

Determining if an abuser has firearms is also difficult. The United States has no national database listing gun owners or even those arrested for gun possession, so each jurisdiction has to do the best due diligence it can. Some, including Wisconsin, have found success simply by asking the victims and the abusers themselves.

In 2014, Washington State legislators unanimously passed a bill requiring people under restraining orders to give up their guns. Not much happened. By 2016, officials in King County, where Seattle is the largest municipality, were wondering why, and they asked a retired judge, Anne Levinson, to convene judges, clerks, prosecutors and police officials to investigate.

Sure enough, what they found was that, despite a weekly docket of 30 or more new domestic violence cases before its civil courts, few offenders were turning in firearms. In fact, for 2016, of 875 people ordered in King County Superior Court to relinquish guns, only 52 gave any up — 124 weapons in total.

Since the cases were civil, prosecutors and law enforcement officers were rarely in the courtroom. Paper records weren’t being shared. No one was taking responsibility to make sure the law was followed. Everyone involved was sure that guns were slipping through the system.

“We make a promise to victims of domestic violence when we issue these orders; they rely on these orders,” says Chris Anderson, a Seattle city prosecutor who, as head of the domestic violence unit, was part of the study group. “We have to commit to enforcement to reduce risk to victims.”

King County tried a new approach, one that identified high-risk abusers and disarmed them. At civil court proceedings, dedicated case managers began presenting evidence, gathered from scouring social media, victims’ statements and various databases for clues that abusers had firearms. In one house, a victim alerted the court to 27 firearms and 8,000 rounds of ammunition — belonging to a man who claimed to have turned over the only two guns he owned. In cases when prosecutors and the police believed that a given abuser was lying and hiding guns, they sought a search warrant and went to retrieve weapons.

In the first six days piloting this concentrated, coordinated effort, law enforcement agencies recovered 20 percent as many firearms as were collected in all of 2015 in King County. That success continued into the fall, and from July 1 to Oct. 13, more firearms were collected than in all of 2016 and twice as many as in 2015. King County will double staffing toward this effort in 2018.

It shows what can be done when judges and law enforcement officials take the responsibility to follow through on sensible gun-safety laws that have wide support.