In this answer, egreg states that "LaTeX counters should always be modified globally". However, the etoolbox package provides the \defcounter macro which will assign a value to a previously initialized counter locally (but may be prefixed with \global). I have been using this macro e.g. to change the value of the secnumdepth counter inside a group:
\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\section{bla}
\begingroup
\defcounter{secnumdepth}{-2}
\section{blubb}
\endgroup
\section{foo}
\end{document}
So: Is egreg's statement about always globally modifying counters correct? If so, why? If not, is the usage of \defcounter in my MWE still bad practice?