ONE MAY NOT COOK FOR NOCHRIM ON YOM TOV
(Beraisa - Beis Shamai): One may not offer Olas Re'iyah on Yom Tov. Melachah of Ochel Nefesh is "Lachem" - not for Hash-m;
Beis Hillel say, "la'Shem" permits this. "Lachem" forbids for Nochrim or dogs.
Therefore, one may invite a Nochri to come to eat on Shabbos, but not on Yom Tov. This is a decree lest one cook extra for the Nochri. If a Nochri came on his own, he may eat from what the Yisraelim already prepared.
21a (R. Yehoshua ben Levi): One may invite a Nochri to come to eat on Shabbos, but not on Yom Tov. This is a decree lest he cook extra for the Nochri.
When a Nochri came on his own to Mereimar or Mar Zutra, they would say 'if you want what we prepared, fine. We will not toil to prepare for you.'
Rif and Rosh (2:14): One may invite a Nochri to come to eat on Shabbos, but not on Yom Tov, lest he cook extra for him. When a Nochri came uninvited to Mereimar or Mar Zutra, they would say 'if you want what we prepared, fine. We will not toil to prepare for you.'
Ran (DH Bo'i): One may not invite a Nochri to eat on Yom Tov, lest he cook extra for him in a separate pot. It is permitted in the same pot, for the stew is better when there is more meat in the pot (17a). Even in another pot is not forbidden mid'Oraisa, for the Halachah follows Rabah, who says Ho'il (since if Yisrael guests will come he can serve them the food, the Torah permits to cook it). Nevertheless, since it is common to cook another pot for him, we are concerned. Some say that the concern is lest he prepare non-Kosher food for the Nochri. Cooking such food on Yom Tov is forbidden mid'Oraisa.
Rambam (Hilchos Yom Tov 1:13): One may not bake or cook on Yom Tov for Nochrim or dogs. "Hu Levado Ye'aseh Lachem" - not for Nochrim or dogs. Therefore, one may invite a Nochri to come to eat on Shabbos, but not on Yom Tov. This is a decree lest one cook extra for the Nochri. If a Nochri came on his own, he may eat from what the Yisraelim already prepared.
Magid Mishnah: The Gemara forbids inviting a Nochri, not feeding him. Therefore it is permitted if he came uninvited, like happened to Mereimar and Mar Zutra. The Rambam holds that it is not necessary to say 'We will not exert ourselves to prepare for you.'
Taz (OC 512:4): The Tur and Rashba require saying this, for we are concerned lest one cook extra for an important Nochri. It seems that we are concerned only if the Yisrael insists that he eat. The Rambam holds that when we are concerned, it does not help to give him what was prepared. We are still concerned lest he cook more. Mereimar and Mar Zutra would tell the Nochri that they may not cook for him so he would not be upset.
Rosh (2:14): If a Nochri messenger came to a Yisrael's house, we may give to him to eat. R. Yehoshua ben Levi forbids only inviting Nochrim, for then the host wants to honor him and serves many courses, and he might cook a pot just for him. We are not concerned for adding more in the same pot, or that one will add for his slave.
Shulchan Aruch (OC 512:1): One may not cook on Yom Tov for Nochrim. Therefore, one may not invite a Nochri to come to eat, lest he cook extra for him.
Mishnah Berurah (2): R. Betzalel forbids cooking for Kara'ites. Others permit, for they err and follow the custom of their ancestors. One who is Mechalel Shabbos in public is like a Nochri.
Note: Presumably, the Poskim who consider most Yisraelim who are Mechalel Shabbos nowadays to be like a Tinuk she'Nishba would permit cooking for them.
Magen Avraham (2): The Tanya permits inviting a Nochri after the meal is fully prepared. It seems that this is only if he did not intend to invite him until after he prepared the meal.
Rebuttal (Mishnah Berurah 3 and Sha'ar ha'Tziyon 4): It is forbidden even after preparing. The Rambam permits only if the Nochri came on his own.
Kaf ha'Chayim (5): For Darchei Shalom, one may say once to a Nochri 'eat', especially if he knows that the Nochri does not eat this food.
Rema: One may send food with a Nochri to a Nochri.
Taz (3): If there is no Isur to carry to the Nochri's house, a Yisrael may take it. Hotza'ah on Yom Tov is permitted only for the needs of Yisraelim. The Isur of inviting does not apply in this case.
Beis Yosef (DH Kasuv b'Hagahos): The Or Zaru'a permits to send to a Nochri through a Nochri. Even though one may not do Melachah on Yom Tov for a Nochri, one may send via a Nochri. Orchos Chayim forbids sending food, for one will surely cook more for the Nochri. He says that the Heter to cook a full pot is only if all of it is for Yisrael. The Poskim disagree.
Darchei Moshe (2): The Beis Yosef understands that the Or Zaru'a discusses sending things other than food. Therefore he discusses Melachah for a Nochri, and not inviting a Nochri. One may not send food, like Orchos Chayim explicitly says. However, Hagahos Maimoniyos holds that the Or Zaru'a discusses sending food.
Taz (5): The Yam Shel Shlomo (2:23) always permits adding in the same pot, for it is all one exertion. He forbids sending to a Nochri lest one cook another pot. This is like Orchos Chayim (but for a different reason), and unlike the Rema.
Mishnah Berurah (8): One may send for the sake of Shalom.
Shulchan Aruch (ibid.): One may feed Nochrim that were not invited, e.g. one's slave, or a messenger sent to the Yisrael's house, or a Nochri who came on his own. We are not concerned lest he cook extra for him.
Beis Yosef (DH Kosav ha'Kol Bo): The Yerushalmi permits to invite a Nochri he does not know, for there is no concern lest he cook extra for him.
Kaf ha'Chayim (7): If a Nochri comes to visit a Yisrael to honor him, the Ben Ish Chai permits to brew coffee, if the Yisraelim will also drink. Even though it is primarily for the Nochri, Derech Eretz requires this.
Kaf ha'Chayim (17): The Rashba says to evade feeding him if possible, to avoid toil and Tiltul for the needs of the Nochri.
Rema: One may cook extra for his slave in the same pot he cooks for himself. For other Nochrim it is forbidden in any case.
Mishnah Berurah (11): The Mechaber equated slaves and Nochrim. The Rema distinguishes them, and permits adding to the pot for an Eved Kena'ani. One may not say that he adds for him. The Taz says that one may add for a Nochri whom he does not esteem, for we are not concerned lest he cook another pot for him. If one esteems a Nochri, he may give to him only food that was already prepared.
Note: It seems that here, 'Eved Kena'ani' refers to a Nochri; it excludes a Yisrael servant. The Mishbetzos Zahav (5), which the Mishnah Berurah cites here, merely says 'Eved'. It is difficult to say that "Lachem" excludes a true Eved Kena'ani. If so, this is a bigger Chidush than Nochrim. Why did the Gemara teach only about Nochrim? R. Akiva allows preparing for dogs because we must feed them. According to Rav, who obligates feeding an Eved Kena'ani (Gitin 12b), R. Akiva should also permit for an Eved Kena'ani! It seems unreasonable that even an Eved Kena'ani cannot cook for himself on Yom Tov! The Gemara (Pesachim 91a) allows a Chaburah for Korban Pesach that is entirely Avadim Kena'anim. If Erev Pesach is on Shabbos, the Korban must be roasted on Yom Tov! The Ya'avetz explains that "Let the king and Haman come to the Mishteh that I made for him" (Esther 5:4) refers to Haman. It was Yom Tov (Pesach), so Esther could not cook for Achashverosh (a Nochri) or herself (she was fasting). She cooked for Haman, who was the Eved Kena'ani of Mordechai. (The Gemara (Megilah Reish 15b) alludes to this, and it is explicit in Yalkut Esther, brought in Etz Yosef there.)
Rema: If a Yisrael bakes in a Nochri's oven and must give to him a loaf, he should not designate beforehand which he will give, for then he bakes it solely for the Nochri. Rather, he bakes all of them Stam, then gives one to the Nochri.
Kaf ha'Chayim (25): If one can give the Nochri flour, one may not bake bread for him.