CALGARY, Canada — Officially, Naheed Nenshi, the mayor of this oil-fueled city, is meant to be addressed as Your Worship, a stuffy, colonial-era honorific that has somehow managed to survive Canada’s transformation into a modern, multicultural nation. “It’s weird,” Mr. Nenshi, a rotund, curly-haired 44-year-old, said one recent afternoon as he sat behind the large wooden desk that dominates his office.

In practice, Mr. Nenshi is far more likely to be addressed as @nenshi, his Twitter handle, which he wields with obsessive, daily devotion. At any given moment, he can be found shepherding constituents’ queries to relevant government agencies or firing off sarcastic retorts to his detractors, who are usually complaining about the use of their tax dollars. His faith rarely comes up, if at all.

For a Muslim man who broke ground when he was elected mayor of a major North American city in 2010, Mr. Nenshi has proved that very few Canadians have a problem with how His Worship actually worships. “Nobody cared,” he said, recalling his first win, a success he repeated in 2013, with 74 percent of the vote.

The son of ethnic South Asian immigrants from Tanzania and a professed public transit nerd, Mr. Nenshi has thrived in a city and country where personal attacks and cultural issues capture little of the political oxygen that has inflamed voters in the United States and Europe.