Generalized eigenvalues of two indefinite Hermitian matrices

Let the generalized eigenpair $\lambda, \mathbf x$ for matrices $A, B$ be defined as $$A \mathbf x = \lambda B \mathbf x,$$ with $A = A^\mathsf{H}, B = B^\mathsf{H}$.

If $A$ or $B$ is positive definite then $\lambda \in \mathbb R$. Indeed: 1. $A > 0$. Using Cholesky decomposition $A = LL^\top$ $$LL^\top \mathbf x = \lambda B \mathbf x\\ \mathbf w = L^\top \mathbf x\\ \mathbf w = \lambda L^{-1} B L^{-\top} \mathbf w$$ thus $\lambda^{-1}$ is an eigenvalue of a Hermitian matrix $L^{-1} B L^{-\mathsf{H}}$. Same for the case of $B > 0$. This still holds for negative definite matrices, one can simply invert the matrix sign.

But a simple example of two indefinite matrices $A = \left(\begin{smallmatrix}1 & 0 \\ 0 & -1\end{smallmatrix}\right), B = \left(\begin{smallmatrix}0 & 1 \\ 1 & 0\end{smallmatrix}\right)$ shows that the eigenvalues $\lambda$ can be complex-valued, for this case $\lambda = \pm i$.

I'm looking for some necessary or sufficient conditions for $\lambda$ to be real in case when neither of the matrices $A, B$ are definite. The one condition I've found is $AB = BA$, it is known that for matrices that commute the eigenvectors are the same, thus generalized eigenvalues are simply quotients of $\lambda(A)$ and $\lambda(B)$, thus real.

Notice that if $A$ is invertible then $\lambda,x$ is a generalized eigenpair iff $x=\lambda A^{-1}Bx$. Since $x\neq 0$ then $\lambda\neq 0$ and $A^{-1}Bx=\frac{1}{\lambda}x$.
Thus, if $A$ is invertible then $\lambda,x$ is a generalized eigenpair, $\lambda\in\mathbb{R}$, iff $\frac{1}{\lambda}$ is a real eigenvalue of $A^{-1}B$.
Now if $A$ is not invertible then $0\neq x\in\ker(A)$ and $0=\lambda$ is a generalized eigenpair with $\lambda\in\mathbb{R}$.
So the problem is to garantee that $A^{-1}B$ has a non null real eigenvalue. For example: if $B$ is invertible and the order of $A$ and $B$ is odd then $A^{-1}B$ has a non null real eigenvalue.
Actually, we can construct several examples of invertible symmetric matrices $A,B$ such that $A^{-1}B$ has no real eigenvalue. If $C$ is real matrix then we can find real symmetric matrices $S_1,S_2$ such that $C=S_1S_2$ (this is theorem 66, pg 76, in Kaplansky's book - Linear Algebra and Geometry: A Second Course ). So if $C$ is invertible without real eigenvalues then $S_1,S_2$ are invertible two. Let $S_1=A^{-1}$ and $S_2=B$.