Evaluate $\int_0^{2\pi}\frac{1}{1 + A\sin(\theta) + B\cos(\theta)}\, \mathrm{d}\theta \ \text{ for }\ A,B <<1$
Note that the integral of interest fails to converge if $\sqrt{A^2+B^2}\ge 1$. So, we restrict $A$ and $B$ such that $\sqrt{A^2+B^2}< 1$.
Then, we can write
$$\begin{align} \int_0^{2\pi}\frac{1}{1+A\sin(\theta)+B\cos(\theta)}\,d\theta&=\int_0^{2\pi}\frac{1}{1+\sqrt{A^2+B^2} \cos(\theta-\arctan(A/B)}\,d\theta\\\\ &=\int_{-\arctan(A/B)}^{2\pi-\arctan(A/B)}\frac{1}{1+\sqrt{A^2+B^2} \cos(\theta)}\,d\theta\\\\ &=2\int_{0}^{\pi}\frac{1}{1+\sqrt{A^2+B^2} \cos(\theta)}\,d\theta\tag1 \end{align}$$
where we exploited both the $2\pi$-periodicity and the evenness of the cosine function.
Next, we enforce the Weierstrass Substitution, $ t=\tan(\theta/2)$, in $(1)$ to obtain
$$\begin{align} \int_0^{2\pi}\frac{1}{1+A\sin(\theta)+B\cos(\theta)}\,d\theta&=4\int_0^\infty \frac{1}{(1+\sqrt{A^2+B^2})+(1-\sqrt{A^2+B^2})t^2}\,dt\\\\ &=\frac{4}{1-\sqrt{A^2+B^2}}\int_0^\infty \frac{1}{\frac{1+\sqrt{A^2+B^2}}{1-\sqrt{A^2+B^2}}+t^2}\,dt \tag 2\\\\ &=\frac{4}{1-\sqrt{A^2+B^2}} \left.\left(\frac{\arctan\left(\frac{\sqrt{1-\sqrt{A^2+B^2}}}{\sqrt{1+\sqrt{A^2+B^2}}}t\right)}{\sqrt{\frac{1+\sqrt{A^2+B^2}}{1-\sqrt{A^2+B^2}}}}\right)\right|_{0}^{\infty} \tag 3\\\\ &=\frac{2\pi}{\sqrt{1-A^2-B^2}} \tag 4 \end{align}$$
Note that we could have written $(2)$ as
$$\begin{align} \frac{4}{1-\sqrt{A^2+B^2}}\int_0^\infty \frac{1}{\frac{1+\sqrt{A^2+B^2}}{1-\sqrt{A^2+B^2}}+t^2}\,dt&=\frac{4}{1-\sqrt{A^2+B^2}}\int_0^\infty \frac{1}{t^2-\frac{\sqrt{A^2+B^2}+1}{\sqrt{A^2+B^2}-1}}\,dt\\\\ &=\frac{4}{\sqrt{A^2+B^2}-1}\left.\left( \frac{\text{arctanh}\left(\sqrt{\frac{\sqrt{A^2+B^2}-1}{\sqrt{A^2+B^2}+1}}t\right)}{\sqrt{\frac{\sqrt{A^2+B^2}+1}{\sqrt{A^2+B^2}-1}}}\right)\right|_{0}^\infty\\\\ &=\frac{4}{\sqrt{A^2+B^2}-1}\,\left(\frac{i\pi/2}{\sqrt{\frac{\sqrt{A^2+B^2}+1}{\sqrt{A^2+B^2}-1}}}\right)\\\\ &=\frac{2\pi}{\sqrt{1-A^2-B^2}} \end{align}$$
as expected!
A solution through complex analysis is missing, so I will provide one.
By De Moivre's identities the given integral equals
$$ \int_{0}^{2\pi}\frac{e^{i\theta} d\theta} {e^{i\theta}+ \frac{A-Bi}{2}e^{2i\theta}+\frac{A+Bi}{2}}=-i\oint_{|z|=1}\frac{dz}{\frac{A-Bi}{2}z^2+z+\frac{A+Bi}{2}}$$ and that is $2\pi$ times the sum of the residues of the function $\frac{1}{\frac{A-Bi}{2}z^2+z+\frac{A+Bi}{2}}$ at its poles inside the unit circle. The poles lies at $\frac{-1\pm\sqrt{1-A^2-B^2}}{A-iB}$ and the computation is straightforward.
When one of $A$ and $B$ is non-zero, then one way to figure this out for yourself is to put $$A \colon= r \cos \beta \ \mbox{ and } \ B \colon= r \sin \beta,$$ where $$r = \sqrt{A^2 + B^2} \ \mbox{ and } \ B \tan \beta = A.$$ Then $$ \begin{align} \int_0^{2\pi} \frac{1}{1+ A \sin \theta + B \cos \theta } \mathrm{d} \theta &= \int_0^{2\pi} \frac{1}{1+r\sin(\beta + \theta) } \mathrm{d} \theta. \end{align} $$ Can you take it from here?
As one trick, you can put $$z = \tan \frac{\beta + \theta}{2}.$$ Then $$\sin (\beta+\theta) = \frac{2z}{1+z^2} \ \mbox{ and } \ \mathrm{d} \theta = \frac{2 \mathrm{d} z}{1+z^2}.$$
When $\theta = 0$, $z= \tan \beta/2$, and when $\theta = 2\pi$, $z= \tan \left( \pi+ \beta/2 \right) = \tan \beta/2$.
So, $$ \begin{align} \int_0^{2\pi} \frac{1}{1+ A \sin \theta + B \cos \theta } \mathrm{d} \theta &= \int_0^{2\pi} \frac{1}{1+r\sin(\beta + \theta) } \mathrm{d} \theta \\ &= 2 \int_{\tan \beta/2}^{\tan \beta/2} \frac{1}{1+2rz+z^2} \mathrm{d} \theta \\ &= 0 \end{align} $$
For $A = B=0$, the answer is $2\pi$, as you've correctly found out.