Indefinite integration is a useful tool, but it can lead us astray at times, including in cases when the integrand has non-integrable singularities. The proper resolution of this problem is definite integration with symbolic limits. This technique has the bonus of not having to find the integration constant at the end of the calculation.
In this context, we are looking at:
$$\int_{v_0}^v \frac{m}{mg-ku^2} du.$$
Here the integrand, because it has non-integrable singularities at $u_1:=-m^{1/2} g^{1/2} k^{-1/2},u_2:=m^{1/2} g^{1/2} k^{-1/2}$, tells us that $v_0$ and $v$ must be in the same one of the regions $(-\infty,u_1),(u_1,u_2),(u_2,\infty)$, otherwise the integral does not converge. Let us write the partial fraction expansion:
$$\frac{m}{mg-ku^2} = -\frac{m}{k} \frac{1}{u^2-\frac{mg}{k}} = -\frac{m}{k} \frac{1}{u_2-u_1} \left ( \frac{1}{u-u_2} - \frac{1}{u-u_1} \right ).$$
For $v,v_0 \in (u_1,u_2)$, the end result after cancelling minus signs is that we have two positive terms, so that integration gives us
$$\left. \frac{m}{k} \frac{1}{u_2-u_1} \left [ \ln(u_2-u) + \ln(u-u_1) \right ] \right |_{u=v_0}^{u=v}.$$
For $v,v_0 \in (u_2,\infty)$ the integration goes differently, resulting in
$$\left. \frac{m}{k} \frac{1}{u_2-u_1} \left [ -\ln(u-u_2) + \ln(u-u_1) \right ] \right |_{u=v_0}^{u=v}.$$
This seems like a minor algebra quirk at a glance, but actually this has a huge impact on the qualitative behavior of the final solution to the differential equation. Physically, when $v_0 \in (u_1,u_2)$, the object will accelerate to its terminal velocity; when $v_0 \not \in [u_1,u_2]$, the object will decelerate to its terminal velocity. (What happens if $v_0=u_1$ or $v_0=u_2$? Why can't this derivation tell us that?)
(Please do check my minus signs, it's quite possible I made a mistake somewhere.)