No, registering for an APIR Code is not mandatory. Rather it is an opt-in decision made by the product issuer.
Please note that once a product is registered, product issuers are bound by the APIR Coding Terms & Conditions, including the requirement to support the code until such time as it is Archived.