This assumes Linux/macOS and a processor with SSE 4.1 (virtually any x64 processor in operation today).

Further reading:

Parsing short hexadecimal strings efficiently
https://lemire.me/blog/2019/04/17/parsing-short-hexadecimal-strings-efficiently/

Parsing hex numbers with validation
http://0x80.pl/notesen/2022-01-17-validating-hex-parse.html