I can’t tell you what Jesus had in mind exactly; I’m not an expert. I assume Jesus is being hyperbolic in order to make a point about not exacting revenge. Moments later he goes on to say “don’t give what is holy to dogs, don’t throw your pearls before swine lest they trample them, then turn and devour you”.
The Bible is constantly “regulating” itself. “Love your mother and father.” “Whoever does not hate his mother and father cannot follow me.” We just have to look through the obvious to understand the deeper message.
The Catholic Church specifically teaches that defending yourself is perfectly appropriate and if death results to the aggressor, so be it, so long as either a) it was an accident or b) killing the aggressor was proportionate to the crime perpetrated against you. Both of these (a and b) must also conform with a criteria: that the method you used to disable the aggressor was appropriate (if you can just as easily stop the situation by brandishing a weapon, shooting in the leg, etc… without risk to yourself, you are not justified in blasting someone in the face)
So, if someone is taking your wallet but isn’t threatening to kill you, you don’t get to blast them in the face. If you have strong reason to believe you’re going to die, blast away if it’s your only viable option.
When it comes to defending someone else that you’re responsible for (ooh, lot of room for debate in that one), it’s actually considered grave matter to protect them. Failing to attempt to therefore makes for one of the criteria of mortal sin (gravity, knowledge, willingness)
2263 The legitimate defense of persons and societies is not an exception to the prohibition against the murder of the innocent that constitutes intentional killing. "The act of self-defense can have a double effect: the preservation of one’s own life; and the killing of the aggressor. . . . The one is intended, the other is not."65
2264 Love toward oneself remains a fundamental principle of morality. Therefore it is legitimate to insist on respect for one’s own right to life. Someone who defends his life is not guilty of murder even if he is forced to deal his aggressor a lethal blow:
If a man in self-defense uses more than necessary violence, it will be unlawful: whereas if he repels force with moderation, his defense will be lawful. . . . Nor is it necessary for salvation that a man omit the act of moderate self-defense to avoid killing the other man, since one is bound to take more care of one’s own life than of another’s.66
2265 Legitimate defense can be not only a right but a grave duty for one who is responsible for the lives of others. The defense of the common good requires that an unjust aggressor be rendered unable to cause harm. For this reason, those who legitimately hold authority also have the right to use arms to repel aggressors against the civil community entrusted to their responsibility.
2266 The efforts of the state to curb the spread of behavior harmful to people’s rights and to the basic rules of civil society correspond to the requirement of safeguarding the common good. Legitimate public authority has the right and duty to inflict punishment proportionate to the gravity of the offense. Punishment has the primary aim of redressing the disorder introduced by the offense. When it is willingly accepted by the guilty party, it assumes the value of expiation. Punishment then, in addition to defending public order and protecting people’s safety, has a medicinal purpose: as far as possible, it must contribute to the correction of the guilty party.67
2267 Assuming that the guilty party’s identity and responsibility have been fully determined, the traditional teaching of the Church does not exclude recourse to the death penalty, if this is the only possible way of effectively defending human lives against the unjust aggressor.
If, however, non-lethal means are sufficient to defend and protect people’s safety from the aggressor, authority will limit itself to such means, as these are more in keeping with the concrete conditions of the common good and more in conformity to the dignity of the human person.
Today, in fact, as a consequence of the possibilities which the state has for effectively preventing crime, by rendering one who has committed an offense incapable of doing harm - without definitely taking away from him the possibility of redeeming himself - the cases in which the execution of the offender is an absolute necessity "are very rare, if not practically nonexistent."68