EDIT : This about explicit notation and clarity, usage of $\sqrt{(-x)^2}= x$ is for demonstrative purposes not for the problem itself.
$\sqrt {(-2) ^2} = \sqrt {2^2}$ causing confusion $-2=2$ which is nonsense.
What seems to be needed is somehow distinguishing between $-2=2$ and explicitly stating $2,-2$ are in the set $S=$same equivalence class of numbers $k$ s.t. $k^2$ having the same value.
Another observation is the order of operation is important, $\sqrt {(-2)^2} = \sqrt {2^2}$ can be evaluated as either $\sqrt {4} = \sqrt {4} =2$ or $ {-2} = {2}$ , how ever implicitly it known that the square function performs first and only after that the square root function can operate, how could this implicit knowledge be worked into explicit notation?
Are there any notations that can be used to make order of operation explicitly visible or instead of ending up with $2=-2$, somehow end up with $2 \equiv-2$ with respect to their squares having same values?