I do not recognize it as a lawful order, and would challenge it, and if our troops were better trained these days, they'd challenge it to.
Ditto for Marines being told they can't have beards or wear green T shirts off duty and off post.
A commander has great discretion, but not unlimited, on post. He has far less discretion off post and less off duty when not in a war zone.
He cannot, for example, prescribe my diet if I am not on a specific medical profile. He cannot prescribe the manner in which I have sex. He cannot prohibit me from making political statements or supporting political positions of any type AS LONG AS I DO NOT USE THE APPEARANCE OF TITLE, RANK OR POSITION to do so. He cannot prescribe who I may or may not marry or associate with in public or private. He cannot prohibit me from driving a car (off duty) or even a motorcycle (Far more dangerous). He cannot prescribe that I wear a dress, a suit, spandex, etc.
He can prohibit attendance in certain establishments, on the grounds that they present an ongoing threat to discipline and order. He cannot prohibit patronizing all such establishments (Forex: barber shops in Korea often double as brothels. A list of prohibited establishments, or a description of the type of service prohibited in context, can be posted. Placing all barber shops off limits crosses that line).
The best way to handle this is for several people to politely contact the post public affairs officer and ask what "significant risk" is posed. Ask for the authority under which the post commander can issue the order regarding non-duty status in a public arena.
COs issue orders exceeding their authority all the time, and it's most common in the Army. Officers are not taught where their limits are, only what their responsibilities are. Those responsibilities are large, and the natural response is to grab as much authority as possible to go with it.
Personal opinion in context but not as a member of the armed forces, only as a private citizen: The General is wrong, and on this NON MILITARY issue clearly personally biased, ignorant and a fool, as well as a grand-standing poser.
Letters to the editor about how soldiers are endangered and easy marks for criminals and terrorists by being unable to defend themselves might help, too.
Considering the general has an armed escort of MPs available for any official travel and many personal functions...