More generally, regarding "a better way": For any matrices $A$ and $B$, let $F(x,y,z) = \det(z \mathrm{Id} + x A + y B)$. This defines a curve in $\mathbb{P}^2$. Your condition is every line through $(0:0:1)$ intersects this curve in a point of multiplicity $\geq m$. This turns out to imply that $F$ must have a component of multiplicity $\geq m$: i.e. $F$ factors as $G^m H$ for some homogenous polynomials $G$ and $H$.
If $A$ and $B$ had a common eigenspace, then $G$ would be linear, and $A$ and $B$ would have direct sum decompositions $A = A_1^{\oplus m} \oplus A_2$ and $B = B_1^{\oplus m} \oplus B_2$ where $(A_1, B_1)$ and $(A_2, B_2)$ give rise to the plane curves $G$ and $H$.
The preceeding examples show that life can be more complicated. In the first example, $F=G^2$, for some nonlinear $G$. In the second, the factorization of $F$ does not correspond to a direct sum decomposition of $(A,B)$.
There is a fair amount of literature on expressing plane curves as determinants, so there is probably someone who has looked specifically in the case of a multiple factor, but I don't know who.

