isContract has switched from
extcodesize for less gas usage in this commit:
But as the important notes mentioned
It is unsafe to assume that an address for which this function returns false is an externally-owned account (EOA) and not a contract. Therefore there would be cases that you would like a more secure check over gas usage. And I would propose to add back the EIP-1052 isContract function with a different name, maybe isSecureContract or something not sure.