Consider a regular holonomic D-module (or a perverse sheaf) $M$ on a smooth variety $X$. Let $f:X\to A^1$ be a polynomial (or holomorphic) function.

**Question**: Is it true that the $\lambda \in A^1$ such that the vanishing cycles $\phi_{f-\lambda}(M) = 0$ is a dense open set?

Here are my thoughts:

If $M = O_X$ (or the constant perverse sheaf $A[dim X]$), this is just the fact that the critical values of $f$ are isolated.

In the general case, we can factor $f$ through its graph $X\to X\times A^1$, $x\mapsto (x,f(x))$, reducing to the case where $f$ is the (smooth) projection $t:X\times A^1 \to A^1$. Our sheaf $M$ on $X\times A^1$ has a characteristic variety $\bigcup_\alpha T^*_{S_\alpha}(X\times A^1)$ for a stratification $X\times A^1 = \bigcup_\alpha S_\alpha$. My guess is that $\phi_{t-\lambda}(M) = 0$ when $\{t-\lambda = 0 \}$ is transverse to all the $S_\alpha$ and that this is a generic condition but I'm having trouble making this intuition precise.