Punishment is required.
However, because we want people to come clean of their own agency (both to make crime-solving take up less public resources, and to make it such that criminals don't have to wait to get caught before becoming productive and non-harmful members of society), we should adjust incentives such that the punishment for coming clean of one's own accord is a little less, and the punishment for getting caught for the same crime is a little more.
Maybe it could be implemented as adding an extra punishment for concealing a crime?