Re: Not that macOS is in any sense perfect …
Actually, Windows has been doing this just as long as Mac OS if not longer.
Files are tagged with an alternate data stream that identifies whether the file came from the local system, trusted network, internet, etc. When you try to open an executable that is flagged as coming from the internet, you're warned that the file is blocked and you have to unblock it or change security settings to allow it to run.