In interviews, several former New York City officials said that they had not heard Mr. Bloomberg, who sat alongside his deputies in an open-plan office, make sexist or offensive comments during their time working together. “No one was made to feel any kind of negativity on the basis of any kind of gender or gender orientation,” said Ester Fuchs, a professor at Columbia who was a senior policy adviser to Mr. Bloomberg during his first term as mayor.

Sign up for On Politics to get the latest election and politics news and insights. Sign up for our politics newsletter

Still, Mr. Bloomberg’s boorish reputation in the 1980s and 1990s was a potential stumbling block even in 2001, when he first took a run at political office. Biographies of Mr. Bloomberg, along with contemporary news reports, have described the company in those days as a hotbed of brusque talk that was often demeaning to women.

One lawsuit, filed in 1997, accused Mr. Bloomberg of reacting poorly upon learning that an employee was pregnant. The employee alleged that Mr. Bloomberg told her, “kill it,” referring to her baby, before grumbling about the number of pregnant women at his company. Mr. Bloomberg denied making the remark; the case was settled with no admission of guilt. In 2001, Mr. Bloomberg’s staff said he passed a polygraph test concerning the comment, though the results were not released.

A class-action lawsuit filed in 2007, alleging a pattern of discrimination at the company against pregnant employees and new mothers, was dismissed by a federal judge in 2011 for lack of evidence.

Mr. Bloomberg — who once described his dating life as a divorced billionaire as “a wet dream” — was married for 18 years to Susan Brown, with whom he has two daughters. He has dated his current companion, Diana L. Taylor, since 2000.

Some friends and colleagues of Mr. Bloomberg say his crude language developed during his upbringing in the 1950s, his college fraternity years at Johns Hopkins and the 1970s machismo of the investment banking industry, which was dominated by men.

Generational differences, however, can be politically perilous in 2019, when the Democratic left is attuned to candidates’ language about gender relations and issues involving harassment and assault.