My parents figured out that the first hour of trick or treat was when the little kids came around. After that, the teens and even adults came looking for handouts. In my neighborhood, these older kids and adults didn't ask; they demanded. So my folks only gave out the candy the first hour. After that, it was lights out and the front door was closed and locked. Not about to have some gangsta hood shoot or beat them up for candy and anything they could loot from their home.
As they grew older, my parents stopped giving out candy altogether. Dad would buy the candy., which Mom would use to make up decorated baskets for the neighbor kids we knew. Halloween afternoon, Dad went around the neighborhood and distributed the baskets for the kids. Halloween night, my folks went out. No need to contend with the punks.
My point here is that we don't need government involvement. If you don't want to give out candy on Halloween, just don't.