I do not think there is a particularly nice answer to this. Below is a suggestion on how you could proceed.
Consider representations $\rho$ of a finitely generated group $\pi$ to $Sl(2, C)$. First of all, the condition that $Tr(\rho(g))=2$ is necessary but not sufficient for $\rho(g)=1$. You can see this by looking at unipotent matrices in $Sl(2, C)$. If $\rho$ maps $g$ to the identity, then for every element $h$ in the normal closure $H$ of $g$ in the ambient group $\pi$, you have $Tr(\rho(h))=2$. One can show that this condition is necessary and sufficient for $\rho(g)=1$. By the Nullstellensatz, it suffices to check this condition only for finitely many elements $h$ in the normal closure $H$.
Now, it should be possible to find an explicit set of such elements of $H$. Doing so is a worthwhile task, I do not think anybody computed this set, it will depend on the word which represents $g$ in terms of generators of $\pi$. If you manage to do this, you can then apply the answer to the special case of generalized knot groups as in your question where $g=m$. Even in the case of knots in the sphere the answer is very likely to be very ugly, and will depend on the knot diagram. However, this is the best I can suggest.