Gaijin is just "foreigner" (though it is a slur, as it's an abbreviated form of Gaikokujin). What you're looking for is "Hakujin", meaning "white person". I'm not sure if it's really a slur, though it does feel a bit odd to me if people use it to refer to me.
Gaijin is not an abbreviated form of gaikokujin, and neither term is really a slur. There aren't a lot of words in Japanese that are unambiguously slurs, like there are in English. That said, there are words that, when used, are used in a pejorative sense more often than not. Hakujin is probably one of them, and kokujin definitely is.