In the video game Assassins Creed: Black Flag, there are certain missions where your character is asked to kill various slavers, plantation masters or free slaves. Your ship's mate is also an ex-slave. (In downloadable content you can play as the ship's mate where his history as a slave is revealed.)
Historically is there any record of pirates or privateers ever fighting on behalf of slaves or acting on their behalf, freeing them or having them join their crews?
Is there any historical record of famous/infamous pirates who had been slaves prior?
From what I understand the Barbary pirates did the exact opposite and took both African and European prisoners and sent them to the slave trade.
Also a follow up question; were pirates only interested in money, gold and plundering or did they have any social or politically driven ambitions?
Historically is there any record of pirates or privateers ever fighting on behalf of slaves or acting on their behalf, freeing them or having them join their crews?
For pirates, generally they were opportunists when it came to slaves, as in exploiting them for profit more often than not. They were European-descended sailors, and that comes with the biases that Europeans bring with them. There's not much evidence to suggest that they suddenly dropped all of their culture in the process. See my post here for more of an explanation on the subject of black men and pirates
Is there any historical record of famous/infamous pirates who had been slaves prior?
You would be hard pressed to find such a case for leadership that isn't a case of fiction mistaken for fact (like Blackbeard's Caesar) or taken out of context (there is a common mistake of confusing the modern meaning of calling someone black and what it meant to call someone black in the early 18th century, they really didn't normally use black to describe Africans - one Dutch man that sailed in the 1690s is often confused as being a black leader as a result).
were pirates only interested in money, gold and plundering or did they have any social or politically driven ambitions?
Generally, as far period evidence suggests, profit and making money drove pirates the most (or was the highest among them). From the pre-1716 Bahama raiders who refused to stop attacking vessels after the War of Spanish Succession ended to continue to make a living, to the rush of men who fell into piracy after trying to grab cash from the Wreck of the 1715 Spanish Treasure Fleet off the Florida coast, to the men who flew the black flag briefly off ships on the African Coast in 1719 who said they hoped to return to the Bahamas to spend their money and then go to sea to raid and repeat the process; the theme of money comes up way too much to ignore as the primary driver of people in piracy. As for other potential inspirations - the society set up by pirates was not as shocking as factoid lists and radical pirate historians would suggest. Many of the rules set up by pirates in their crews were not original to the pirates, but inspired by various aspects of life in the Atlantic world in the 17th and early 18th century. So this idea of "running off to join the libertine and free societies of pirates" is more inspired by modern romanticism and wishes for escapism more than anything. As for political ambitions, there is evidence that a number of pirates showed favoritism towards the Jacobite movement in England at the time - but this is to be expected since a portion of the general population of Europe showed they too showed favor to the Jacobite movement (so why wouldn't that also be seen in among pirate crews). Was it a major driving factor to get into piracy? No sign of that really, but it was there and did help some crews feel a bit more united and likely recruit some men by showing that they had something in common. There is a good article on the subject written by a Dr. Ed Fox called “Jacobitism and the ‘Golden Age’ of Piracy, 1715-1725.” International Journal of Maritime History 22, no. 2 (December 2010): 277–303.
Most of the above applies to pirates in the 1690s-1720s in the Atlantic World. If you are interested in knowing more about how Assassin's Creed 4: Black Flag measures up to history, see this piece I wrote up about it