I don't happen to have one of these with me, but I think you could have some fun with a laser and some CV.
Laser barcode scanners work by shining a laser line on the code and reading how the light reflects back to it. If you have a laser (I would recommend green, based on some 3D scanning tests in the past) and a camera, why not trying to make it happen?
Go ahead and 3D print a case for the ESPcam and the laser, tweak some camera parameters (exposure and brightness) and see if the image gets you some results.
The image above shows a barcode on a white background with a 7pt green line with 50% opacity on top of it. Note how the colors differ. Now setup some thresholds and you should be able to see only the light on top of the white parts. Voila, you are done.
That is a hardware solution, with some very simple computer vision. Thresholds and color filtering should be good for the ESP32 to handle. If you want a software-only solution, you can always convert the barcode to the vertical lines and play with their distance, which should also not be a problem for the LX6 beast (Or, would it?).
If it shows not feasible, I'm sure that you can do this with some python a RPi and stream the image data with some simple HTTP (base 64, you know). Server response gets you the data. With the expected delays and errors.