The punctured disk $\mathbb{D}^*$ is the union of the open sets $D_1 = \mathbb{D}\smallsetminus\mathbb{R}_{\leq 0}$ and $D_2 = \mathbb{D}\smallsetminus \mathbb{R}_{\geq 0}$. We now use the following statement:
Let $f$ be a holomorphic and nonvanishing function on a simply connected open set $U$. Then there is a holomorphic function $g$ on $U$ such that $f = e^g$.
This gives that $f = e^{g_1}$ on $D_1$ and $f = e^{g_2}$ on $D_2$ for some holomorphic functions $g_i$ on $D_i$. Since $e^{g_1} = e^{g_2}$ on $D_1\cap D_2 = \mathbb{D}\smallsetminus \mathbb{R}$, we conclude that $g_1 = g_2 + 2\pi im$ on the upper half disk and $g_1 = g_2 + 2\pi in$ on the lower half disk for some integers $m,n\in\mathbb{Z}$.
We will show that $f = z^{m-n}e^h$ for some holomorphic function $h$ on $\mathbb{D}^*$. To do this, note that $f = z^{m-n}z^{n-m}e^{g_1}$, so we need only show that $z^{n-m}e^{g_1}$ extends from a holomorphic function on $D_1$ to a holomorphic function of the form $e^h$ on $\mathbb{D}^*$. Writing $z^{n-m}e^{g_1} = e^{g_1 + \log|z| + i(n-m)Arg(z)},$ we see that we only need to show that $h(z) = g_1 + \log|z| + i(n-m)Arg(z)$ extends continuously (and hence holomorphically) to $\mathbb{D}^*$. For $r\in \mathbb{R}_{<0}\cap \mathbb{D}$, the limit $\lim_{z\to r}h(z)$, taken over $z$ in the upper half disk, is exactly $\lim_{z\to r, Im(z)>0}g_1(z) + \log|z| + i(n-m)Arg(z) = \lim_{z\to r,Im(z)>0}g_2(z) + 2\pi im + \log|z| + i(n-m)Arg(z)$$ = g_2(r) + 2\pi im + \log |r| + i\pi(n-m) = g_2(r) + \log|r| + i\pi(n+m).$ Similarly, $\lim_{z\to r, Im(z)<0}g_1(z) + \log|z| + i(n-m)Arg(z) = \lim_{z\to r,Im(z)<0} g_2(z) + 2\pi in + \log|z| +i(n-m)Arg(z)$$=g_2(r)+2\pi in + \log |r| -i\pi(n-m) = g_2(r) + \log|r| + i\pi(n+m).$ This shows that $h$ extends continuously (and hence holomorphically) to $\mathbb{D}^*$. Therefore $f = z^{m-n}e^h$.