You should never use \let for commands with optional arguments.
Let's see what happens in this case, taking into account that
\renewcommand\section[2][]{\second{#1}}
actually defines two commands: one is \section which takes no argument and the other one is \\section (with a backslash in its name).
The job of (the redefined) \section is to check for a following [ and to call \\section with the appropriate two arguments, the first being the default if no [ followed \section.
Now you do \let\third\second and \renewcommand\section[2][]{\third[#1]{#2} will basically redefine \\section in terms of itself, causing an infinite loop.
If you use \NewCommandCopy instead of \let (or \LetLtxMacro with the letltxmacro if you have an older LaTeX), there will be no infinite loop.
\sectionis just parsing for[then using (the same) internal command at each stage which you are over-writitng. – David Carlisle Sep 06 '21 at 10:29\letuse\NewCommandCopy, reason: see above. – Skillmon Sep 06 '21 at 10:29