RAW, it is inconsistent (and mostly unclear)
So, the thing is: each of these features has a different text. And these texts are inconsistent between each other. Even mechanically, the features themselves are different. Some features require actions to issue the command, others don't; some require verbal commands, others allow for mental commands; some are living creatures, almost independent creatures, others are animated/completely controlled stuff. Thus, answering the question for every feature at the same time is basically impossible.
Furthermore, some of the features don't have, in my opinion, a clear answer to your question. Some of them are, in my opinion, very unclear in what you can and can not command and how the "thing" behaves when not commanded. In this cases, it's up to DM interpretation of the feature.
As case studies, let us see the examples you mentioned, and also the Conjure spells.
Staff of the Python
Part of the description of the staff of the python says (emphasis mine):
On your turn, you can mentally command the snake if it is within 60 feet of you and you aren't incapacitated. You decide what action the snake takes and where it moves during its next turn, or you can issue it a general command, such as to attack your enemies or guard a location.
See, the difference between issuing every turn or not is that, if you have to issue the command every turn, then once you have been incapacitated, you don't control the snake any more. In this case, I would say the intention is unclear, since the snake is kind of a living creature that could act on its own and it is not described how it behaves when not commanded. Ultimately, I don't think it is a meaningful enough difference and I would allow you to say "attack until dead" and follow it through.
Animate Objects (and Animate Dead)
The relevant parts of the descriptions of the animate objects and animate dead spells share very similar wording (emphasis mine):
As a bonus action, you can mentally command any creature you made with this spell if the creature is within [X] feet of you (if you control multiple creatures, you can command any or all of them at the same time, issuing the same command to each one). You decide what action the creature will take and where it will move during its next turn, or you can issue a general command, such as to guard a particular chamber or corridor. If you issue no commands, the creature only defends itself against hostile creatures. Once given an order, the creature continues to follow it until its task is complete.
The major differences here are that:
- It describes what happens if a command is not issued.
- It costs a bonus action to issue an action command.
The points against allowing you to issue a command saying "attack the creature until it is dead" are:
- Allowing the objects to attack every turn without spending your bonus
action is a huge action economy buff and I would even say nearly game
breaking for a spell that is already strong like Animate Objects.
- The text states that, if the command you are issuing is "an action",
it is only valid for its next turn.
The points in favor of allowing are:
- You could interpret "attack until it is dead" as a "general command"
that the creature must follow "until it is complete".
My interpretation and decision as a DM would be that you can issue the command "attack until the creature is dead", but only for simplicity and flavor. It would still require you to use your bonus action every turn to issue the command. If you get incapacitated, the spell ends (it requires concentration), so that's not a problem.
The description of the conjure elemental states, in part:
It obeys any verbal commands that you issue to it (no action required by you). If you don't issue any commands to the elemental, it defends itself from hostile creatures but otherwise takes no actions.
Again, the difference now is that it does not cost an action, but also it's a verbal command (not mental communication). Thus, it could be negated through the use of, for example, the silence spell. On the other hand, the text is considerably less explicit on what commands you can issue, for how long it follows them, and seems to accept a more general command, such as "attack it until it's dead". This is further supported by the fact that the conjured creatures are somewhat independent, living creatures. Thus, in this case, I would allow the player to command "attack until it is dead", and the command would still be valid even if the player character gets silenced.
Beast Master ranger
The description of the Beast Master ranger feature Ranger's Companion says (PHB, p. 93):
It takes its turn on your initiative, though it doesn’t take an action unless you command it to. On your turn, you can verbally command the beast where to move (no action required by you). You can use your action to verbally command it to take the Attack, Dash, Disengage, Dodge, or Help action.
I think, in this case, it is clear that yes, you need to use your action and command it every turn to attack. It's probably the most unambiguous of these features.
Again, it depends on the feature, and for some of them, it depends on DM interpretation. I would say that, if commanding has an action cost, then certainly you need to spend that action every turn, as is the case with animate objects costing a bonus action. On the other extreme, if it costs no action and is a living creature, as is the case with the conjure spells, then it should be independent enough to obey a long-lasting command such as "attack until dead" without problems.