Surely there have been many human beings throughout our history who have, despite not believing in Islam, have been extremely decent, kind people.
Some of them of course were born before the Prophet, so it would be unreasonable to expect them to be believers without knowing what to believe. If one of the tenants of Islam is to profess the shahada, how would an ordinary person living in, say, ancient Egypt be expected to know about monotheism, much less Mohammad?
Now others of course were born later, but maybe they had not heard of Islam, they were prohibited from following Islam, etc.
My question is: is there any room, in mainstream Islam (Sunni or Shia), for such people to avoid hellfire? Is there an Islamic purgatory? Are there exceptions for righteous people who live decent lives?