Here is another solution based on well known facts about calculating determinant of block matrices:
Suppose $A$ is an $n\times n$ matrix with the black decomposition
\begin{align}
A=\begin{pmatrix} A_{11} & A_{12}\\ A_{21} & A_{22} \end{pmatrix}
\end{align}
where $A_{ii}$ is a squared matrix of size $n_i\times n_i$, $i = 1,2$.
If $\operatorname{det}(A_{11})\neq0$ then
\begin{align}
\operatorname{det}(A)=\operatorname{det}(A_{11})\cdot\operatorname{det}(A_{22}-A_{21}A^{-1}_{11}A_{12})\tag{0}\label{zero}
\end{align}
If $\operatorname{det}(A_{22})\neq0$ then
\begin{align}
\operatorname{det}(A)=\operatorname{det}(A_{22})\cdot\operatorname{det}(A_{11}-A_{12}A^{-1}_{22}A_{21})\tag{0'}\label{zerop}
\end{align}
Suppose $A$ and $B$ are matrices of size $k\times \ell$ and $\ell\times k$ respectively. Consider the matrix $L$ of size $n\times n$, where $n=k+\ell$, given by
\begin{align}
L:=\begin{pmatrix} I_k & A\\ B & I_\ell\end{pmatrix}
\end{align}
where $I_k$ and $I_\ell$ are the identity matrices of size $k$ and $\ell$ respectively. Then, by \eqref{zero} and \eqref{zerop}
$$\operatorname{det}(L)=\operatorname{det}(I_k - AB)=\operatorname{det}(I_\ell - BA)\tag{1}\label{one}$$
Let $p_{AB}$ and $p_{BA}$ denote the characteristic polynomials of squared matrices $AB$ and $BA$ respectively. Then, by \eqref{one}, for any $t\neq0$
\begin{align}
p_{AB}(t)&=(-1)^k\operatorname{det}(tI_k - AB)=(-t)^k\operatorname{det}(I_k -\tfrac1tAB)\\
&=(-t)^k\operatorname{det}(I_\ell - \tfrac1t BA)=(-1)^k t^{k-\ell}\operatorname{det}(tI_\ell - BA)\\
&= (-t)^{k-\ell}p_{BA}(t)
\end{align}
From this identity, it follows that or any $t_*\neq0$, $t_*$ is an eigenvalue of $AB $ iff $t_*$ is an eigenvalue of $BA, $ and moreover, the (algebraic) multiplicity of $t_*$ as an eigenvalue of $AB$ is the same as an eigenvalue of $BA$.