One possible approach would be to use the Drupal user registration form, so that event registrants would be signing up for an account on your event website.
Your custom module could use the
entity.form_builder service to load this form.
You can easily add custom fields to the user entity.
One of those fields could be a QR code. There are several contributed modules that can generate a QR code in a block or a field; this is one choice:
The Drupal website user registration process already sends a welcome email which can be customized at
admin/config/people/accounts so you may be able to include the QR code field by using a token such as
The tricky part will be validating the QR code, but if you can generate a code for an absolute link to the user profile, a Drupal user with appropriately-configured user role could log in to the site on their mobile device and scan the QR codes at the event to verify the user's identity and registration status.