Confusion about contour integration of constant function: intuition vs. Residue Theorem

No, because $dz$ does not represent arclength - rather, $|dz|$ does. So the correct statement would be

$$\oint_{\gamma} dz = 0, \quad\quad \oint_{\gamma} |dz| = 2\pi r$$

Remember, you can always go back to the Riemann sum; when defining the integral $dz$, you sum things that look like $\Delta z$. If you move in a circular path, you don't travel anywhere - hence, the sum of $\Delta z$ is zero.


If $f$ is the constant fuction $1$, The integral $$\int_\gamma f(z)\,dz$$ does not give you the length of the arc $\gamma$. That would be $$\int_\gamma f(z)\,d|z|,$$ where $d|z|$ is integration with respect to arc-length.