That is not technically correct. There is no definition "as soon as they receive it". In fact the law calls for "expeditiously or remove" access. Courts confirmed many times that days or weeks is considered expeditious.
Github could've easily take the time and wait for SymPy to file counter notice which then allows Github to keep the content up up until courts say otherwise. Github instead elected to remove content immediately. By their choice.
If you don't take down something you get a DMCA notice for, do you lose safe harbor status for everything, or just for that one thing? If the latter, then wouldn't it be a good move for GitHub to ignore DMCA requests that their lawyers are sure wouldn't hold water?
As I understand, there are different safe harbors and each applies at the "service" level. It's "online service providers" that have safe harbor status.
If you lose safe harbor status you become liable for infringing content on that service.
Infringement still has to happen and you'd still have to be taken to court and lose, but it's now "as if" you yourself uploaded everything.
So in this instance GitHub would be fine, but if they didn't take down the content then they themselves would become liable for any fringing content on their platform.
Or rather Microsoft would become liable, I suppose.
AFAIK, they're legally required to take down material as soon as they receive a DMCA notice or else lose their safe harbor status.
https://en.m.wikipedia.org/wiki/Notice_and_take_down