(Based on this, it’s noteworthy to point out that Abraham and his descendants circumcised themselves because they were commanded to do so as Noahides, not because they voluntarily decided to observe the Torah before it was given.)
As a general rule, any command mentioned in the Torah before the account of Mattan Torah and then repeated afterward is considered a duty for both Noahides and Israelites for all times – i.e., even after Mattan Torah. Circumcision is an exception. Why?
The Gemara answers that the repetition of the command (in Parshat Tazriah) is not a standard repetition. It is there only to teach us that brit milah is performed even on Shabbat. So once the Torah was given to the Jewish people at Sinai, circumcision became a commandment exclusively for them – even though before Mattan Torah the command applied to both Noahides and Israelites.
The Gemara mentions another view – that brit milah was never intended for all Noahides. It was only meant for Abraham and his progeny. The Gemara objects to this view Ishmael was one of Abraham’s children. And yet, G-d clearly tells Abraham (Genesis 21:12) “ki b’Yitzchak yikarei lecha zara – through Isaac will offspring be considered yours” – i.e., only Isaac, not Ishmael.
The Gemara asks whether this verse includes all of Isaac’s offspring, including Esau and his descendants. It responds that the word “b’Yitzchak – through Isaac” excludes some of Isaac’s progeny, i.e., Esau and his descendants.
How about the children of Ketura, the woman Abraham married after Sarah’s death? The Gemara acknowledges that Abraham circumcised them, and even did so on the eighth day after their birth, yet it says they are excluded from the mitzvah based on the words in Genesis 17:14: “et briti heifar – he has invalidated my covenant.”
Rashi (s.v. “l’rabot Bnei Ketura”) writes that only Ketura’s children had to be circumcised; their progeny have no such requirement.
The Rambam (Hilchot Melachim10:7), encapsulating our Gemara, writes, “Only Abraham and his progeny were given the commandment of circumcision, as the verse states (Genesis 17:9): ‘[Vayomer Elokim el Avraham, ve’atah et briti tishmor,] atah ve’zar’acha acharecha [l’dorotam] – [G-d said to Abraham: And as for you, you shall keep My covenant,] you and your offspring after you [throughout their generations].’ Excluded are the progeny of Ishmael because the verse states (Genesis 21:12): ‘ki b’Yitzchak yikarei lecha zara – through Isaac will offspring be considered yours.’ Excluded as well are the progeny of Esau [here Rambam cites a verse (Genesis 28:4) different than that offered in our Gemara].”
The Rambam continues: “Our sages said that the sons of Ketura, who are the progeny of Abraham, born after Ishmael and Isaac, must be circumcised. Since nowadays the sons of Ishmael are interspersed with the sons of Ketura, they all must be circumcised on the eighth day. But they do not receive the death penalty [for failure to do so, unlike when they fail to keep the Noahide laws].”
The Kesef Mishneh explains this last statement as follows: Since we know that gentiles receive the death penalty if they violate the seven Noahide laws, we might have thought they also receive the death penalty if they fail to keep the commandment of circumcision. However, that is not the case. They only receive the death penalty for failing to keep the Seven Noahide laws, not any other.
The Mishneh L’Melech disagrees. He writes that it is very possible that he descendants of Keturah would ordinarily receive the death penalty for failing to keep the commandment of circumcision. Nowadays, though, because the descendants of Keturah are interspersed with the sons of Ishmael, they only have to circumcise themselves and their children based on a safek, a doubt concerning their ancestry. So although they (the sons of Ketura and Ishmael) must fulfill the commandment of circumcision, they do not receive the death penalty if they don’t do so since their obligation arises out of doubt.