Most very heavy-duty cutting jobs in steel require at least sulfur or chlorine, often both. The effect is chemical. As others have mentioned, it prevents chip welding and the like.
Chlorine is always provided as a chemical compound, of a kind convenient to the use. Chlorinated paraffin is common. One can also force chlorine into oils under temperature and pressure, causing a chemical reaction that binds chlorine atoms to the oil molecules.
As for personal hazard, the worst was carbon tetra-chloride, which is no longer available. It was associated with liver cancer, but the correlation wasn't all that strong.
As for phosgene generation, one can certainly make phosgene, but not enough to matter in machining, unless you are spaying incandescent chips everywhere. Like in hard turning at 10,000 rpm.
War story. When I was teenager, for unremembered reasons I was using carbon tet along with a red-hot electrical cone heater (used in a scoop reflector as a local room warmer), and started noticing this new smell, like new mown hay. ... New mown hay? ... I recall that smell from a college chemistry text that my parents had. It was the smell of phosgene! Oops! Shut everything down and went out into the clean air. Coughed for a few hours, then recovered.
Chlorinated paraffin is pretty benign - molecule too big to go anywhere. People also use flowers of sulfur (a very fine dust of elemental sulfur) in mineral oil, where the sulfur melts and acts as a high-temperature lubricant.
And then there is black sulfur cutting oils. In this case, sulfur is forced into mineral oil at high temperature and pressure, just as for chlorine. One can do both chlorine and sulfur at the same time.