If it ain't broke, don't fix it.
You could also argue that \$M4 + M7\$ has nicer kerning, and the numbers aren't dropped (47 vs. \$47\$) and would be more consistent if TeX was used throughout the question.
You could argue that it's unnecessary, and it most certainly isn't strictly necessary. You could also argue that TeX itself isn't necessary. That would be true, we could use ASCII and HTML markup in many situations, and images in other situations, but TeX is much, much nicer in some situations.
Don't let it bother you. There's no need to edit the post to remove that.
\$\mbox{Note that you could also write whole paragraphs in TeX. That would be completely}\$
\$\mbox{unnecessary and the font would be off. I would agree with an argument to edit}\$ \$\mbox{abuse like that out. However, using it for math where ASCII math would be fine}\$
\$\mbox{is an entirely different matter.}\$