I'm studying in Krasnoyarsk (Siberia) and I want to visit a friend in the UK. How can I go about getting a visa, without traveling all the way back to SA?
There is no requirement to apply for a UK visa from a country you're a citizen of. Applying from a country where you are resident and not a citizen is common, but it is not mandatory even to be resident for visit visas. Since you will need to give evidence of your studies in Russia, it will be easier to apply from Russia, since the visa application centre will be familiar with whatever documentation you provide.
You can make applications for a visit visa, a short-term study visa, an EEA family permit, Tier 5 or Tier 1 (Exceptional Talent) entry clearance in any visa application centre, British diplomatic mission or consular post overseas where entry clearance applications are accepted.
You should be present legally in the country or territory you’re applying from.
It seems to me that your closest option will be the application centre in Novosibirsk, a mere 800km away!