Prove $\frac1{2πi}\int_C\frac{ζ^2(1-n)z^{-n}}{2\cos(nπ/2)}\,{\rm d}n=-γ-\frac12\log z-\frac1{4πz}+\frac zπ\sum\limits_{n=1}^{+∞}\frac{τ(n)}{z^2+n^2}$
Solution 1:
I'd say shift the contour to the left to reach the region where $\zeta(1-s)^2=\sum_{m\ge 1} \tau(m) m^{s-1}$ converges absolutely and uniformly on the vertical lines.
No problem to do so because $\zeta(s)$ is $O(|s|^r)$ in the vertical strip so the exponential decay of $1/\cos(\pi s/2)$ makes it ok.
This will add two residues at $0$ and $1$.
Then use the absolute/uniform convergence to say that $$\int_{(-1/2)} \frac{\zeta(1-s)^2}{2 \cos(\pi s/2)} z^{-s}ds=\sum_{m\ge 1} \tau(m)\int_{(-1/2)} \frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s}ds$$ Where the last integral is easily computed with the residue theorem, for $z\in (0,1)$:
$$\int_{(-1/2)} \frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s}ds = 2i\pi \sum_{k=0}^\infty Res(\frac{m^{s-1}}{2 \cos(\pi s/2)} z^{-s},-2k-1)$$ $$= 2i \sum_{k=0}^\infty \frac{m^{-2k-2}}{(-1)^k} z^{2k+1} = \frac{2i z}{m^2+z^2} $$
You can extend to the remaining $z\in \Bbb{C}-i \Bbb{Z}_{\ge 1}$ by analytic continuation.