Especially when walking or cycling longer distances carrying a lot of groceries in plastic shopping bags can become quite irritating. Any hacks to optimize this?
A useful hack: Protect your fingers
So, the worst thing when walking is that the plastic straps can start cutting into your hands incredibly painfully. Normally this is not too bad, but sometimes it can really become too uncomfortable. In those rare cases I have wrapped my wallet through the plastic hole of the bag(s), thus giving a nice protected area. If you have an expensive wallet it's definitely not advisable, but with an old crappy wallet it really works quite well. The big advantage is that you do not need anything that you don't usually carry with you.
The obvious: Distribute weight
When walking make sure to have two bags where each arm carries a similar weight. When cycling make one bag heavy and another bag light. Carry/hold the heavy bag on the luggage rack whilst carrying the lighter bag in the hand you use for steering.
The most commonly suggest option would be to use a carabiner as @mkingsbu stated in his answer. This is great as an option, but it tends to be unevenly allocated as far as weight distribution goes.
Your best bet is to go with something cylindrical. As you can see in the image below, it essentially takes the stress points out of the carrying/transportation of the plastic bags.
A common tool I like to when I can't find anything myself, is simply a BIC lighter of mine, it does this well and allows me to carry the bag without straining my fingers.
Have you considered getting a backpack? Even reusable shopping bags will have a better grip on them and dig into your hands less than free plastic bags. You can also disperse the weigh in your hand if you put something like a fat marker pen through the handles and grip that.