Solution (source code)

= Solution

On $D=\mathbb C\setminus[0,\infty)$ choose the <continuous> argument $0<\arg z<2\pi$, and put
$$
\boxed{z^w=\exp\bigl(w(\log|z|+i\arg z)\bigr).}
$$
This is <holomorphic> on the slit <plane> for every fixed $w$. The upper boundary value at $x>0$ is $x^w$, whereas the lower boundary value is $e^{2\pi iw}x^w$. This difference is exactly what the <keyhole contour> measures.