Some Jews practice Shalom Zachar which is a Seudat Mitzvah for new born baby boys (the origin is Talmud niddah 30b saying Jews know the Torah in the womb but lose its knowledge after birth). My question is should they do it if a baby is born from Caesarean section? Or does it make no difference, unlike other aspects of Halacha where it would?
The Ashkenazi custom is to make a shalom zachor, on the first Friday night after a baby boy is born. as you write it is for form of comforting the newborn boy, who just forgot what he was taught in his mother’s womb. this practice is done regardless whether the baby was delivered via Caesarean section or not. there is one place however where it will make a difference, which is that even if the baby is the first born to his mother, his father will not be obligated to do a pidyon haben, as the child is not considered the first to leave the womb.
תלמוד בבלי מסכת בכורות דף מז עמוד ב “יוצא דופן והבא אחריו – שניהן אינן בכור לא לנחלה ולא לכהן” וכן פ’ בשולחן ערוך יורה דעה הלכות פדיון בכור סימן שה סעיף כד יוצא דופן והנולד אחריו כדרכו, שניהם פטורין. הראשון, מפני שלא יצא מהרחם; והשני, מפני שקדמו אחר.