I seldom wear the helmet and the wife always wears hers. If riding and not wearing the helmet I put the helmet under a cargo net on top of the tour pack rack.
When we stop for lunch or to sight see we just leave them sitting on the seat. Have never had a problem. But with half or 3/4 helmets the only way to secure them to the bike is through the "D". Not the best solution but probably enough to keep an honest person honest. After all that is all a lock is good for, if they really want it they will find a way to get it regardless of the locks.
I have used a bicycle cable lock to secure the helmets to the luggage rack when we leave them for extended periods of time. At night they go in the room or inside the tour pack.