We have shops that use this scenario. For us, when the cashier calls the total, you say something like, "Oh, I forgot about XYZ. Could you add this, please?" We have not had a shopper report an issue during the 3 years I have been with Shoppers' View.
As someone who used to work at a grocery store, I would encourage you to not worry about the scenario. It is extremely common to forgot about something in your cart. The nice thing to do would be to bring it to the service desk or leave it with the greeter (if you can't bring it to the cashier's attention). However, if you aren't comfortable with that, it is not uncommon to have customers leave items in the cart when they leave.