If you like being a loner why do you really care what they think? Are you going to change anything about yourself to please them, or more likely your perception of what they are thinking? For all you know they are staring and thinking, "Wow, I wish I was as brave as ____. He/she never gives into to peer pressure and isn't afraid to be his/herself."
I'm a loner at school and people always stare at me. How can I stop worrying what they think of me? (I like being a loner.)
Just smile at them.
Well that might make people come over. You can be a loner and talk to people too no reason to just avoid all social interaction.
You can be a nicer "loner" They stare because they can't figure you out. Say hi, smile, how's it going, nice day huh?, or anything remotely friendly then move on. A blank stare without emotion, or ignoring others existence makes you look cold and uncaring. They don't know you are a loner, they only know what you show them.