Ventura docs for M2 Macs in this comment: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4555340#gistcomment-4555340
Old Monterey docs in this old revision: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd/32c410e3a1de73539c76fa13ea5486569c4e0c5d
Solution for Sonoma: https://gist.github.com/sghiassy/a3927405cf4ffe81242f4ecb01c382ac
How I erase my Mac and get rid of the notifications:
Clean erase
Reinstall OS from recovery partition.
Aster first boot I turn off the router in my house so I can bypass the mdm screen an continue with the setup process.
I create a user so I can disable csrutil.
After all is done I restart and boot into recovery.
Open terminal and follow this procedure:
$ csrutil disable
$ reboot
Back in recovery and terminal
$ cd "/Volumes/Macintosh HD/System/Library"
$ cd ../../etc
$ echo "0.0.0.0 iprofiles.apple.com" >> hosts
$ echo "0.0.0.0 mdmenrollment.apple.com" >> hosts
$ echo "0.0.0.0 deviceenrollment.apple.com" >> hosts
$ echo "0.0.0.0 albert.apple.com" >> hosts
$ echo "0.0.0.0 acmdm.apple.com" >> hosts
$ csrutil enable
$ reboot
Never had any issues with the method.