What's the Q of a pole at the origin of the s-plane?
Note that the formula given in your question is valid for a system with a complex-conjugate pole pair $p$ and $p^*$ with $\text{Re}(p)\neq 0$. As you've correctly pointed out, if for $|p|&gt;0$ the real part $\text{Re}(p)$ approaches zero, the $Q$ factor approaches infinity. This is the case for a pole pair on the $j\omega$-axis with $|p|&gt;0$, i.e. not at $s=0$.

Also note that you can't use that formula for two distinct real-valued poles. That situation corresponds to an overdamped system with $Q&lt;\frac12$.

The problem with a double pole at $s=0$ is that there is no reasonable way to evaluate the formula given in your question. The corresponding limit does not exist.

Having said that, we can think of a reasonable definition of $Q$ for the case of a double pole at $s=0$.
For $p=p^*=0$ the transfer function of the corresponding system is (assuming no finite zeros)

$$H(s)=\frac{A}{s^2}\tag{1}$$

with some constant $A$. The impulse response is

$$h(t)=\mathcal{L}^{-1}\{H(s)\}=A\,t\,u(t)\tag{2}$$

We have to ask ourselves what we mean by $Q$ in this case. Since the damping is zero, you could say that $Q=\infty$. I haven't come across a definition of $Q$ in the case of a double real pole at $s=0$, and I think that for this degenerate case there cannot be any useful definition. If I had to decide on a value, I'd say $Q=\infty$, in analogy with all other pole pairs on the $j\omega$-axis.