This problem becomes quite a bit more tedious to handle when instead we have $\cos(\theta-\theta_0)$
Following from Claude's advice
$$\tag{1}I(b) = \int_0^{2\pi} \ln\big(a-b\cos(\theta-\theta_0)\big)d\theta_0$$
because we are not integrating wrt b (and I'm pretty sure the bounds of integration not containing b is also a requirement, but I'll have to fact check that later), we are allowed to commute
$$\frac{\partial}{\partial b}\int_0^{2\pi} f(a,b,\theta,\theta_0)d\theta_0 = \int_0^{2\pi}\frac{\partial}{\partial b}f(a,b,\theta,\theta_0)d\theta_0$$
$$\tag{2} I'(b) = -\int_0^{2\pi} \frac{\cos(\theta-\theta_0)}{a-b\cos(\theta-\theta_0)}d\theta_0$$
We'll solve (2) by first using polynomial long division: $\int_{-\pi}^{\pi} -\frac{a}{b\big(a-b\cos(\theta-\theta_0)\big)}+\frac{1}{b}d\theta_0$ and from the tangent half-angle substitution, $\cos(\theta-\theta_0) = \frac{1-t^2}{1+t^2},d\theta_0 = \frac{2}{1+t^2}dt, t = \tan(\frac{\theta-\theta_0}{2}),t_0 = \tan(\frac{\theta+\pi}{2}), t_f = \tan(\frac{\theta-\pi}{2})$ and our integral becomes:
$$-\frac{2}{b}\int_{t_0}^{t_f}\frac{1}{(1+t^2)\big(a-b\frac{1-t^2}{1+t^2}\big)}dt_0+\frac{2\pi}{b} \\ = -\frac{2}{b}\int_{t_0}^{t_f}\frac{1}{\big((a-b)+(a+b)t^2\big)}dt+\frac{2\pi}{b} \\ = -\frac{2}{b(a-b)}\int_{t_0}^{t_f}\frac{1}{\big(1+\frac{a+b}{a-b}t^2\big)}dt+\frac{2\pi}{b} \\ = -\frac{2}{b\sqrt{a^2-b^2}}\int_{\sqrt{\frac{a+b}{a-b}}t_0}^{\sqrt{\frac{a+b}{a-b}}t_f}\frac{1}{\big(1+u^2\big)}du+\frac{2\pi}{b} \\ = -\frac{2}{b\sqrt{a^2-b^2}}\int_{\arctan\Big(\sqrt{\frac{a+b}{a-b}}t_0\Big)}^{\arctan\Big(\sqrt{\frac{a+b}{a-b}}t_f\Big)}\frac{\sec^2(x)}{\big(1+\tan^2(x)\big)}dx+\frac{2\pi}{b} \\ = -\frac{2}{b\sqrt{a^2-b^2}}\Bigg(\arctan\bigg(\sqrt{\frac{a+b}{a-b}}\tan\Big(\frac{\theta-\pi}{2}\Big)\bigg)-\arctan\bigg(\sqrt{\frac{a+b}{a-b}}\tan\Big(\frac{\theta+\pi}{2}\Big)\bigg)\Bigg) + \frac{2\pi}{b}$$
And we can see from this result that the inclusion of $\theta$ has resulted in a significantly more verbose integrand. I do not have a reference answer, so if anyone spots a mistake, please let me know.
The next step is to integrate $I'(b)$ to get $I(b)$, which works because of Fubini's theorem since $f'(a,b,\theta,\theta_0)$ is continuous from $0\le \theta_0 \le 2\pi$ and the bounds of integration are independent of b: $I(b) = \int_0^{2\pi} \int f'(a,b,\theta,\theta_0) db d\theta_0 = \int \int_0^{2\pi}f'(a,b,\theta,\theta_0)d\theta_0 db$. Or
$$\tag{3}I(b) = 2\int \frac{1}{b}\Bigg(\pi - \frac{1}{\sqrt{a^2-b^2}}\bigg(\arctan\Big(\sqrt{\frac{a+b}{a-b}}\tan\big(\frac{\theta-\pi}{2}\big)\Big)-\arctan\Big(\sqrt{\frac{a+b}{a-b}}\tan\big(\frac{\theta+\pi}{2}\big)\Big)\bigg)\Bigg) db$$
The resulting indefinite integral can have its constant, $C$, evaluated by using $I(b=0) = 2\pi \ln(a)$.
Does anyone have any issues with how I'm solving this problem? Maybe there's an even simpler way?
EDIT: My indefinite integral looks like it might violate it after all. Technically the indefinite integral would be the same as $\int db = \int_0^b db - F(0)$ so our bounds of integration for one of the 2 integrals would technically include the variable of integration. However, if I made up a brand new variable and definitely integrated it like Lai did here, THEN I think it'd be mathematically legal. Should still yield the same result unless I'm mistaken.