no, it is not "The Law"
there is no law forcing you to sign, however if you do not sign, your employer is responsible for prepaying your taxes, which will be refunded to them when you file your return and pay the tax, so no, NOBODY will hire you without a W4 wage and tax withholding agreement, since your employer would be on the hook for paying your income taxes if you fail to file.
the "agreement" was crafted to transform your employer into the tax collector, BEFORE any tax is due or payable, so you will have to file to get your remaining "refund" back.
if the "agreement" were actually compulsory under law, it would be unconstitutional.
most employers will SAY "it's the law" but it aint.