Deducing $\int_0^{\pi}\log \sin x dx =-\pi\log 2$ from $\int_0^{\pi}\log (-2ie^{ix}\sin x) dx = 0$

Since $2\sin x>0$ between the integration limits, we can focus just on $\ln(-ie^{ix})$. As Ahlfors notes, $\log(-i)=-\pi i/2$ is the branch choice for which $\ln(-ie^{ix})$ has range $\subseteq(-\pi,\,\pi]$ (in fact, it's $[-\pi/2,\,\pi/2]$). Any other branch shifts the range by some integer multiple of $2\pi$, so it's no longer constrained as desired.