Buyers are part of a Daily Event in which someone will come and offer to buy your slave for some amount of Gold. If you decide to sell your slave, you will get the Gold. However, you will be forced to go to Court later and possibly pay a Fine and lose Renown if you lose the trial.
Selling your slave normally does not have an effect on the ending. If you sell to a woman, the text at the end will still be based on a male slave owner, High Priestess Daruna still picks up Rei, etc. A notable exception is that Menace's former owner will react to having Menace sold to someone else.