Why does God not execute Cain in Gen 4:11? That is the punishment required in the Mosaic code. Is exile not quite a lenient sentence?

Humanity did not yet live under the Mosaic code, which indeed states clearly: “And he that killeth any man shall surely be put to death.” (Lev 24:17) The next murder occurs just a bit further down in the same chapter, when Cain’s wicked descendant, Lamech, kills a man and no punishment, either from man or God, is recorded. It is not until after the Flood that Noachian code include a more severe punishment: “Whoso sheddeth man’s blood, by man shall his blood be shed: for in the image of God made he man.” (Gen 9:6) Now, Cain’s murder of Abel is only the second documented sin, and the first documented act of violence. It seems God might well forbear shedding more blood, even for the sake of justice, when the horror of this first murder is so awful. We are not told of Adam’s and Eve’s reaction to the slaughter, but they were no doubt devastated. The combination of murder when there were probably not many people on earth at the time (possibly only four), together with exile, was probably horror enough to teach the lesson, to that generation, that murder is to be avoided.