Given the definite integral:
$$
I(a,\,b) := \int_0^{\frac{\pi}{2}} \frac{\cos\left(a\,\arcsin\left(b\,x\right)\right)}{\sqrt{1 - \left(b\,\sin x\right)^2}}\,\text{d}x
$$
through a substitution of the type $t = \frac{4}{\pi}\,x - 1$ we go back to this other integral:
$$
I(a,\,b) = \int_{-1}^1 \underbrace{\frac{\cos\left(a\,\arcsin\left(b\,\frac{\pi}{4}\,(t + 1)\right)\right)}{\sqrt{1 - \left(b\,\sin \left(\frac{\pi}{4}\,(t + 1)\right)\right)^2}}\,\frac{\pi}{4}}_{:= f(a,\,b,\,t)}\text{d}t
$$
to which it's possible to apply the Legendre-Gauss quadrature.
In particular, opting for the two-point formula:
$$
I(a,\,b) \approx k_1\,f(a,\,b,\,t_1) + k_2\,f(a,\,b,\,t_2)
$$
where is it:
$$
\begin{cases}
k_1\,t_1^0 + k_2\,t_2^0 = \frac{1 + (-1)^0}{1 + 0} \\
k_1\,t_1^1 + k_2\,t_2^1 = \frac{1 + (-1)^1}{1 + 1} \\
k_1\,t_1^2 + k_2\,t_2^2 = \frac{1 + (-1)^2}{1 + 2} \\
k_1\,t_1^3 + k_2\,t_2^3 = \frac{1 + (-1)^3}{1 + 3}
\end{cases}
\; \; \; \Leftrightarrow \; \; \;
\begin{cases}
k_{1,2} = 1 \\
t_{1,2} = \pm \frac{1}{\sqrt{3}}
\end{cases}
$$
it follows that:
$$
I(a,\,b) \approx f\left(a,\,b,\,-\frac{1}{\sqrt{3}}\right) + f\left(a,\,b,\,\frac{1}{\sqrt{3}}\right),
$$
approximation that involves at most an error equal to:
$$
\epsilon(a,\,b) = \frac{1}{135}\underset{-1 \le t \le 1}{\max} \left|\frac{\partial^4 f(a,\,b,\,t)}{\partial t^4}\right|.
$$
As an example:
$$
I\left(3,\,\frac{1}{10}\right) \approx f\left(3,\,\frac{1}{10},\,-\frac{1}{\sqrt{3}}\right) + f\left(3,\,\frac{1}{10},\,\frac{1}{\sqrt{3}}\right) = 1.51672
$$
with a maximum error equal to:
$$
\epsilon\left(3,\,\frac{1}{10}\right) = \frac{1}{135}\underset{-1 \le t \le 1}{\max} \left|\frac{\partial^4 f\left(3,\,\frac{1}{10},\,t\right)}{\partial t^4}\right| = 1.08341\cdot 10^{-4}\,.
$$
Best Answer
Here is a rather circuitous route. Maybe there is a more compact way to do this:
$$\require{cancel}\begin{align*} \int_{-\pi}^\pi \frac{\mathrm dx}{\sqrt{(t-2\cos x)^2-4}}&=2\int_0^\pi \frac{\mathrm dx}{\sqrt{(t-2\cos x)^2-4}}\\ &=4\int_0^\infty \frac{\mathrm du}{\sqrt{((t+4)u^2+t)(tu^2+t-4)}} \qquad \small{\left(u=\tan\frac{x}{2}\right)}\\ &=\frac4{\sqrt{t(t+4)}}\int_0^\infty \frac{\mathrm du}{\sqrt{\left(u^2+\frac{t}{t+4}\right)\left(u^2+\frac{t-4}{t}\right)}}\\ &=\frac{4\cancel{\sqrt{t(t+4)}}}{\cancel{\sqrt{t(t+4)}}}\int_0^{\pi/2} \frac{\mathrm dv}{\sqrt{t^2-16+16\sin^2 v}} \quad \small{\left(u=\sqrt{\frac{t}{t+4}}\tan\,v\right)}\\ &=4\int_0^{\pi/2} \frac{\mathrm dv}{\sqrt{t^2-16+16\sin^2 v}}\\ &=4\int_{-\pi/2}^0 \frac{\mathrm dv}{\sqrt{t^2-16+16\sin^2 v}}\qquad\text{(symmetry)}\\ &=4\int_0^{\pi/2} \frac{\mathrm dv}{\sqrt{t^2-16+16\cos^2 v}}=4\int_0^{\pi/2} \frac{\mathrm dv}{\sqrt{t^2-16\sin^2 v}}\\ &=\frac4{t}K\left(\frac{16}{t^2}\right) \end{align*}$$