Even back like 15 years ago the systems at the chain grocery stores would read the info on the checks and query the banks to verify funds were available to cover the charge.
The same system would also print all the info on the check, ask for the person to sign it and then scan it in. Some systems would even put a copy on the receipt.
Since checks are so rarely used now, I've got no idea if that tech got cheaper or more prevalent, but, it's not really that different than a card in terms of ease of use or holding up the line as long as the person doesn't insist on filling out the check themselves.
It's actually hilarious, my electric company wants to charge me a 3% fee for credit or debit. Instead, my bank just mails them a check through their bill pay system (no fee). It's crazy that something being physically printed and mailed is the cheaper way to go, but here we are.