You're very correct that many aspects of our criminal laws are medieval in origin and lifted intact from England circa 1789 with remarkably little change over the intervening 250 some odd years.
The codification of criminal laws (meaning rendering them into statutes and then into organized penal codes) effected a sort of modernization of criminal laws that was mostly unintentional. That is, the goal was to get them written down, not to improve them or adapt them to modern civilization, although some of that occurred.
But with that came the shift of the definition of crimes and penalties from the judicially controlled common law to the legislative branch. And with that came political pandering by criminal legislation.
Somewhat surprisingly, I think Texas did a pretty damn good job of codifying and modernizing its Penal Code. It is so much "cleaner" and freer of medieval concepts than the criminal statutes of most states. And Texas, again surprisingly, has largely avoided much of the pandering by criminal legislation that has occurred at the federal level, which has been out of control for decades.
And I think one of the reasons for that is guidance from professors at our universities, including Bob Dawson, George Dix, and others.
The one major complaint I have about all of it is a general one toward legislatures everywhere. They enact stuff and rarely revisit it to evaluate whether it carried out its original purpose, produced unintended and undesirable consequences, and should be revised or replace or repealed.