Yes. Core doesn't view it as a standard transaction and it won't be relayed nor mined by the client.
However, if you were to remove that code, it is still possible for it to be mined since it doesn't violate the protocol rules. If most miner SPV mines, then they probably don't use Bitcoin Core directly or modify the codes slightly. Of course, such transactions are unlikely to appear but they are valid, if they can get into a block which doesn't make the transaction invalid in the first place. It has happened before and I don't think any major changes happened.
The second link is for oprhan transactions, which isn't applicable to most transactions.