My road bike is sorely lacking in good locations to mount a rear light, but I ride in the dark a fair amount. I have an Ortlieb bar bag that I've relocated to a T Bar attached to the seat post, and I realized that it has a couple of snap connectors that I could use. They're intended for attaching a map pocket.
I don't know how durable this will be, it's an experiment. The snaps seem to be pretty positively locking, but probably if you snapped them in and out a lot they would wear out quickly. Since I plan to just snap it in place and leave it there, I hope this will last.
The snaps are 5mm farther apart than the measured distance on the bag. After printing, use a heat gun to soften a strip about 1/3 of the way along, then put in a twist that will bring the center bit out and vertical when snapped onto the bag. Hold a few seconds while the plastic cools. Repeat 1/3 of the way from the other side. Clip on the light using the strap clip (if your light didn't come with one, you'll have to improvise).