I think that's handled by the barcode scanner itself, at least on the ones I've used. The scanner will not recognize the same code immediately, but will immediately pick up a different code.
What's slow is that after each scan it needs to check the weight which means it lets the scales settle for one second before accepting another scan.
Now take that, and add someone in our Polish supermarket chain (Biedronka) having the dumb "insight" to disable "scan multiple" option. Until ~month ago, whenever buying something in larger quantity, I could just press "Scan multiple", tap in the amount, scan the barcode once, and move all the items of the same type to the "already scanned" zone. Now, I have to do it one by one, each time waiting for the scales to settle. Infuriating when you're buying some spice bag or candy and have to scan 12 of them one by one.