The derivation path scanner does not really need to know the BIP39 seed phrase and passphrase. These are only needed when writing the wallet file to disk, not for the temporary memory-only wallets that the scanner uses.
This will enable later non-BIP39 BIP32 schemes such as slip39.
As a side-effect the derivation path scanner now supports wallets with passphrases (previously it always assumed passphrase = "")
This is somewhat inspired by https://github.com/spesmilo/electrum/pull/6917/commits/19d04546df1380a8bfd7e302f4e55fc7062dc486
except that we cannot exactly backport this commit because we will still need to pass the seed phrase to on_restore_bip39 because we want to save the seed phrase and passphrase to the wallet file. Also Electrum does not have a derivation path scanner.