OPINION — I do not think that you can legislate so-called common sense. Someone who ignores signs designed to protect them is unlikely to be aware of a hiking law.
Since the summer heat conditions are also dangerous for the rescuers, post a sign that states: “Under conditions X-Y-Z rescues will not be conducted.” It is more important to protect a trained resource than to protect someone who ignores signs designed to protect them.
Sadly, many of the people who get into trouble in the heat on our hiking trails are from out of town. That is another argument that a law would not be productive.