Did you ever notice that the Commandments do not forbid lying in general, but rather the specific business of “bearing false witness”?

When you tell a lie that does no harm... or more, one that spares someone pain... you are not violating the Commandments. And anyone who’s ever loved an elderly person knows how it is to keep from them information you know they will worry over with no possibility of resolution. Sparing someone needless misery is a good reason to conceal information from them, or to misstate truth to them. There are other situations in which the “white lie” is the right thing to do. It all comes down to motivation.
Are you lying to do GOOD to someone? If that’s real, you’re good. Truth is generally better than lies, but there are occasions when the lie is better. They are RARE. But they do exist. A mindless commitment to nothing but truth at all times is a thing that eventually hurts an innocent. You are supposed to go through this life with judgment and compassion.
No, what the commandment condemns is the lie that is motivated by self-betterment. The lie that causes you to avoid consequences of what you said or did. The lie that deflects responsibility onto an innocent person in order to resolve the problem your guilt has caused.
And let’s face it — almost all lies are of the second variety.
The wording also implies a legal proceeding, so that you have already sworn or otherwise committed to tell the truth.
But the key here is motivation. A lie to benefit someone else is not the thing God opposes. It is the lie that is SELF motivated. A lie imputing guilt to someone innocent with whom you have an adversarial bent. A lie claiming a good act which you did not actually perform. A lie to gain a reward or to avoid a punishment.
They are ancient, but rather like the constitution, the Ten Commandments are very, VERY well formed.