"For Your Eyes Only," which was the 12th film in the "Bond" franchise and the first one to be released in the 1980s, is the only film in the series that does not include the M character in any capacity. Instead, it sees the character of Bill Tanner (James Villiers) step into this role, though he's never referred to as M. As for the real-life reason, Bernard Lee, who had played the M character up until that point, died of cancer in early 1981 (via New York Times). Apparently, M had been included in the script, but the actor was too sick to film his scenes.
Either way, "For Your Eyes Only" remains the sole "Bond" movie to not feature the M character, and the reason is a sad one. The role of M continues to live on, however, recently being played by acclaimed actor Ralph Fiennes. Now that Daniel Craig's time as Bond has come to an end with "No Time to Die," however, who knows what direction the character of M and the franchise as a whole will go in.