First disable Tamper Protection in the Microsoft Defender settings itself. Then using Windows Powershell (admin) disable the real-time protection with the below cmdlet.
Set-MpPreference -DisableRealtimeMonitoring $true
Alternative method is using the Group Policy Editor.
Turning off real-time protection permanently even after restarting.
OPTION FIVE – Turn On or Off Real-time Protection for Microsoft Defender Antivirus | Tutorials
This link should also provide you with other useful things to switch off/on. Like disabling telemetry.
Microsoft has slightly changed some things so they may be worded differently. Such as Windows Defender is now called Microsoft Defender so older guides may not reflect that. Tamper protection needs to be also disabled.
Links & References
- Turn off Windows Defender in Windows 10 permanently – ALI TAJRAN
- Turn off Defender antivirus protection in Windows Security
- Enable and configure Microsoft Defender Antivirus protection capabilities | Microsoft Docs
- Turn On or Off Real-time Protection for Microsoft Defender Antivirus | Tutorials