Why is it impossible to set value to attributes from scripts?

So I keep encountering this problem in HA and I wish to discuss it if it is ok to do so.
90% of my issues are just “Now I just need to set that attribute to that value… and nope”.
Examples among others:

  • Dynamically change entity_picture of media_player with the source being selected to reflect its state.
  • Change icon color based on the state of the sensor (I know about the custom component for that but it refuses to work here)
  • Update a sensor by changing its polling frequency for a few seconds to avoid polling every 2s 24/7

I read that old thread about it already but that is a hack and a half for a quite common operation : affectation.

Is there any reason this is so hard to do in HA ? Am I mistaken and there is a clean way to do so ? Or is this a philosophy of the devs ?