There are two conflicting ideas in criminal law
Of course, in real legal systems it’s a mess, a mix of these two ideas (both of them a bit naive anyway, to be honest) and many others.
But the kernel of good from them can be taken and used.
What I propose is like a criminal record, but for people who have never been convicted of a crime.
It is for anybody who has committed a crime, but for whatever reason has not been punished. I’m thinking for example of all the people who maim or murder, and whose crime is in the newspaper for a day or two then forgotten.
If the crime has been documented (for example in the media) and is not just a slander, it is added to a publicly searchable list. The definition of “crime” is (as always) flexible. It’s up to the people making the list to define it. So the list would be maintained probably by a non-profit org set up exclusively for this.
That theire names are known and remembered, and their crimes recorded forever - it could be a small dicincentive for people to do crime, for those who normally have none.