In theory, it may also be possible to put the entry stamp on a separate piece of paper that you will show them on exit. Israel does this as a standard procedure for people who also visit countries that won't let them in if their passport has an Israeli stamp. I have absolutely no idea if any other country ever does this, and it would be highly unusual elsewhere even if that other country's rules permit it, so I wouldn't suggest showing up at the immigration desk with a full passport and a blank sheet of paper - but who knows?