The error message pop up is not controlled by Microsoft Defender SmartScreen so there's no use to switch it off.
I know that you want to control it with Selenium but there's no Edge option that can override the warning in Selenium. The solutions in other threads are for old versions of browsers. safe browsing
is now the default behavior so it won't work either. There's not much Selenium can do with the warning.
If you want to get rid of the warning when downloading xml
files, you can only set this group policy first, then use Selenium to automate.
For more information, you can also refer to this thread. In the accepted answer of the thread, it uses PowerShell script to update Windows Registry to set the group policy, you can also use it as a workaround.