To answer the question why the italic 7 of Latin Modern is shifted upwards although it has no descender: It actually has an invisible descender, that is, its bounding box has the same depth as the italic 4. The other italic numbers don't have this feature (or is it a bug?).
\documentclass{article}
\usepackage[margin=15mm]{geometry}
\usepackage{showcharinbox, anyfontsize}
\begin{document}
\begin{center}
\ShowCharInBox{\fontsize{200}{210}\selectfont 6}
\vskip 1cm
\ShowCharInBox{\fontsize{200}{210}\selectfont 4}
\vskip 1cm
\ShowCharInBox{\fontsize{200}{210}\selectfont 7}
\newpage
\ShowCharInBox{\fontsize{200}{210}\selectfont\textit{6}}
\vskip 1cm
\ShowCharInBox{\fontsize{200}{210}\selectfont\textit{4}}
\vskip 1cm
\ShowCharInBox{\fontsize{200}{210}\selectfont\textit{7}}
\end{center}
\end{document}
Thanks to @Robert for adding the following quote of Knuth (at the very end of cm85.bug):
I absolutely guarantee that the TFM files will never change again.
(Otherwise I would consider zeroing the depth of italic 7, which I
admit is strange... we can live with it.)
It is important that the TeX base does not change (execpt from bug fixes), because it is the very basis for frameworks that are much more complex. Therefore even minor changes in the TeX base can easily lead to errors in higher-level code. Obviously this descender is not considered a bug, at least not a serious one.
To this, I add a quote from TeX FAQ:
Knuth has declared that he will do no further development of TeX;
he will continue to fix any bugs that are reported to him
(though bugs are rare). This decision was made soon after
TeX version 3.0 was released;
\tikzmarknode
(which is what you'd want to use here) as provided by thetikzmark
library has thebaseline
option already included.\usetikzlibrary{tikzmark}
plus\newcommand{\oct}[1]{\tikzmarknode{oct_#1}{\itshape{'#1}}}
works.