If I were to disable this check at all (IsRestrictedForScript always returns false), would I run into any issue?
It depends on the design of the .NET API you're calling from script code. In general you'll probably be OK.
The default behavior is aligned with C#. Where C# requires a cast, so does script code. Your change will allow you to avoid casting in some situations, but it may also force you to cast in places where C# doesn't.
I ran all the unit test and there's no error at all.
You're right, and that's something we need to fix.
Cheers!