This time San Francisco wants to be second — second in the nation to have a publicly owned bank, that is. There’s only one right now: the Bank of North Dakota.

The reasons? The legalization of marijuana in California, the constant demand that the city divest from one bank or another for one political reason or another, and the fact that undocumented immigrants can’t get bank accounts.

“The time is now to begin addressing this, because people in San Francisco are at a point where they are no longer willing to accept the status quo and they are open to exploring other alternatives,” said Supervisor Malia Cohen, who wants to create a task force to assess the feasibility of establishing a San Francisco-owned bank.

Supervisor Sandra Fewer agreed: “Now is the time. Especially when we see the big banks are investing in bad actors that are not aligned with San Francisco values. This would give us control over our money.”

And San Francisco has company. The Oakland City Council’s Finance and Management Committee is set to look into setting up a bank where cannabis businesses could park their money.

The nation’s only public bank, the Bank of North Dakota, was created in 1919 in a populist wave when farmers there were unhappy with decisions being made by major banks. Its mission is to promote agriculture, commerce and industry in that state.

The idea of a bank owned by San Francisco has been bandied about for a few years. A 2011 report by the city’s budget and legislative analyst listed the potential benefits of a city-owned bank: creation of a new revenue stream without raising taxes, decreased borrowing costs, and increased support for small businesses and community development programs.

Another potential benefit: It would give San Francisco more control over how its money is spent — an issue in a city that regularly tries to divest from banks, companies, states and countries viewed as unaligned with its progressive values.

In recent years, supervisors have called for divesting from banks that helped finance the Dakota Access Pipeline; Wells Fargo Bank, because it opened 2.1 million unauthorized accounts; and companies producing fossil fuels, firearms and ammunition.

Most banks are incorporated with the federal government as a standard corporation, or C corporation, meaning their primary fiduciary responsibility is to maximize shareholder value. If San Francisco were to open a public bank, it could incorporate as a benefit corporation, or B corporation, meaning it could prioritize other goals.

Cohen said she hoped a city-owned bank could help undocumented immigrants, who are largely left out of the banking system because of federal laws aimed at preventing money laundering. Those laws mean bank customers must produce a driver’s license or other legal form of identification. As a result, unauthorized immigrants rely on check-cashing services, which charge high fees.

Joseph Lynyak III, an expert on regulatory reform who advises banks and financial institutions, said a public bank would run into the same problems of needing to check customer identification. Still, he said, he thought work-arounds could be found. “Theoretically you could do it,” he said.

Lynyak was less optimistic that a city-owned bank could open accounts for cannabis dispensaries, because marijuana is illegal under federal law. The federal government could charge the bank with “aiding and abetting violation of federal drug laws and also engaging in money laundering,” he said.

But Fiona Ma, a member of the California Board of Equalization, said she believed a public bank could do business with dispensaries in limited circumstances. She said dispensaries might be able to hold their money in a city-owned bank, take out cash only in San Francisco and use it to pay local taxes. Still, she acknowledged, there would be some risk.

“The question always is, can the federal government come and take the money if it’s not used for taxes and it’s just sitting there in an account?” Ma said.

Fow now, there are more questions than answers. Among the questions Cohen wants the task force to look into: how much initial capital the city would need to open the bank and where that money would come from, operating costs, scope of operations, how it would be insured, potential revenue streams and risks.

City Treasurer Jose Cisneros said he would consider the idea, but didn’t exactly endorse the concept.

“The treasurer takes his fiduciary responsibility seriously,” his spokesman, Amanda Fried, said in a statement. “The voters have elected him four times to keep the city’s money safe. He is reviewing this resolution carefully, and looks forward to working with the Board of Supervisors to better understand their policy goals regarding the creation of a municipal bank.”

Cohen said opening a bank would be tough, but thought it could be done.

“I think it’s realistic. It will be incredibly difficult, though.”

One thing’s for sure: It wouldn’t be called the Bank of San Francisco — there’s already a private bank with that name.

Emily Green is a San Francisco Chronicle staff writer. Email: metro@sfchronicle.com Twitter: @emilytgreen