So far it looks like the score is even between the Beit Joseph and Reb Chaim.
If you look at the Rambam about slavery after you have looked at the Talmud it seems like he is saying that if Jew buys a gentile from another gentile that if the gentile is smart he will jump into the Mikvah [any natural body of water] and shout out "Leshem Ben Chorin" [For the sake Freedom!!] before the owner has a chance to dip him in he becomes Jewish and is free. [But also he is required to keep all the mitzvot.]
The way it looks to me is that this does not refer to a case in which the gentile sold himself. [In a case where he had a lots of debts and wants to pay them off.]
The reason is that after looking at the Talmud itself this is the opinion of Rav Awyia. However so far we do not know if the Rambam decides like Rav Awyia. But is is significant that the Rambam says he buys him from a gentile. It seems implied that if the gentile sold himself that this would not work.
Reb Chaim disagrees with this.He says in any case the gentile can jump into the mikvah and becomes free. and he has a good argument for this. And in this we will see if I can get a chance to write about it that he is disagreeing with the Beit Yoseph.
First of all both to Reb Chaim and the Beit Yosph the Rambam is deciding not like Rav Awyia but rather Rav Achai is opponent in the Talmud. and though to Rav Awyia there are two kinds of acquiring Reb Chaim holds that to Rav Achei there is only one--that is a type of acquiring that only gives the owner the right to dip the gentile in the mikvah , and until then no slavery exists.
I hope everyone is truly shocked. Yes there is slavery in the Torah. And the Torah does mean what it says. And the commandments are not good advice, they are laws. When the Torah says for example to honor your parents it does not mean to be nice to them. It means something much more radical. Homosexually is also the same. Slavery come to think of it might be a great idea. If there would be slavery in the USA maybe you would not have a Muslim Brotherhood president in the White House.