"...and so, he left the building. But before, he pinned a sheet of paper on the wall, written in a nearly undecipherable way of writing, down there: using 26 glyphs of a long lost language. Hopefully, it was translated below in the Seven Languages of the Union, allowing anyone here to understand the desires of that strange person, which came looking for people to go on a strange expedition. It was nearly a joke. But, he was looking serious and determined to accomplish his mission, which is, finding humanity... "
You can't really stop them from spawning any other way, not in vanilla that is. You could set up a command block near the world spawn (so it stays loaded) and have it detect and kill any hostile mobs out there.
Another option would be to use mods. WorldGuard for example which allows you define regions and set up flags for those regions. That would allow you to deny hostile mob spawning for the __global__ region, thus effectively removing all hostile mobs despite the difficulty setting.
Im doing a survival map. So I need to let all passive mobs alive and prevent hostile mobs from spawning and yet play in normal mode with all Features. If I can use mods I dont mind. I just need creepers and zombies to stop annoying me