Effect of multiple `gobble=<int>` accumulate, not overwrite
The total effect of \setminted{gobble=1, gobble=2} is gobble=3, but the expected is gobble=2.
From https://tex.stackexchange.com/q/650135
Example:
\documentclass{article}
\usepackage{minted}
\parindent=0pt
\begin{document}
\subsection*{minted works wrong}
\setminted{gobble=1, gobble=2}
expected: 3456
\begin{minted}{text}
123456
\end{minted}
\subsection*{fvextra is ok}
\fvset{gobble=1, gobble=2}
expected: 3456
\begin{Verbatim}
123456
\end{Verbatim}
\end{document}

Currently gobble is defined by
https://github.com/gpoore/minted/blob/d46f1ba2d248f2f3504bcc795dd39c613bd3c5a0/source/minted.dtx#L2662-L2664
Hence \setminted{gobble=1, gobble=2} will become pygmentize options -F gobble:n=1 -F gobble:n=2.
I don't know if there is an easy way to fix this. The current system for working with pygmentize is based on the assumption that later options override earlier ones instead of combining. So one solution would involve a complete redesign of pygmentize option handling. Another possibility is to do gobble in LaTeX when writing the code to the temp file. That is possible, but will require special handling of UTF-8 code points for pdflatex.
I expect that there are other bugs related to pygmentize options combining rather than overriding, so even if it's possible to fix this by switching the processing to the LaTeX side, the pygmentize processing probably needs to be reimplemented anyway.
So one solution would involve a complete redesign of
pygmentizeoption handling.
+1 to a general fix for \minted@def@optcl.