Sql sanitization isn't foolproof either. That is why prepared statements are the best practice.
This is an entirely different thing from trying to reduce the probability of an attack working.
Unless you're using a build of msyql that predates mysql_real_escape_string, because the _real version takes the connection character set into account and the previous version didn't.