According to The Hockey News, MacTavish didn't always forgo the helmet. In fact, he wore one when he first began playing for the Boston Bruins in 1979. Moreover, the publication notes that MacTavish also used a helmet while he was in college. Prior to being drafted into the team, MassLive states that the Canadian native attended the University of Massachusetts Lowell. However, MacTavish soon changed his mind about using a helmet. He stated (via The Hockey News), "I practiced all the time without one, and then I decided, ah, f*** it, I'm not going to wear one." That being said, MacTavish was able to do this for a reason.
AP News reports that the NHL officially made helmets mandatory during the 1979-1980 season. Per The Hockey News, any player who had been drafted prior to this could sign a waiver to exclude them from wearing a helmet. If a player had entered the NHL after June 1, 1979, they were out of luck and had to wear a helmet. MacTavish was drafted by the Bruins in 1978 (via Hockeydb).
Needless to say, he opted to sign the waiver to play without a helmet. For whatever reason, MacTavish decided to bring the helmet back for one season. He explained, "I tried putting one on one year (1988-89) and ended up having my best career year offensively, and we won the Stanley Cup in Edmonton, but for whatever reason I took it off the following year" (per AP News).