Pain killers while breastfeeding?

Hey ladies! Looking for opinions--this is my second child. I'll be having a scheduled c-section as VBAC is not an option for me. I did not breastfeed the first time around, but I'm considering it for this baby. I have to say I waiver back and forth on my decision. I have no real desire or emotional connection to the idea of breastfeeding, and I truly believe my kids will be healthy and smart either way. Trying to keep an open mind though; saving money is always a plus and who knows, maybe I'll just love it. (Pats on the back for both breastfeeding and bottle feeding mommas, you all rock.✨)
Anyway, I was wondering how you can be on pain killers post-Caesarian and breastfeed without transferring the substance to your child (like you transfer alcohol). I asked my doctor today, and she basically said that you absolutely do transfer it. She said it's not necessarily bad for them, you may just notice they're more drowsy. I realize people do it all the time, but this strikes me so funny. If my breast milk can have narcotic effects on my baby, is it really a healthier option for them than non-laced formula?