[Backport maintenance/4.0.x] Wrong inference with default argument values (#2924)

Fix overzealous filtering of `IfExp` inference (#2914)

(cherry picked from commit 178a796d01b43240638921400bc71212c1b2b05e)

Co-authored-by: jkmnt <git@firewood.fastmail.com>
3 files changed