Extensive biblical and traditional material advocating for Mary's painless childbirth can be found from "The Virginity of Our Lady in Partu". Many Protestants reject this teaching, but most are unaware of it entirely. I don't know the status of this teaching among Protestant theologians.
The image of light passing through glass seems to originate in the 12th century, and becomes very widespread by the 14th century. See this scholarly overview of the sources:
Breeze, Andrew. "The blessed virgin and the sunbeam through glass." Bells: Barcelona English language and literature studies 2 (1990): 53-64.
The teaching continued to be promulgated through the Catechism of the Council of Trent:
"He is born of His Mother without any diminution of her maternal virginity, just as He afterwards went forth from the sepulchre while it was closed and sealed, and entered the room in which His disciples were assembled, the doors being shut; or, not to depart from every-day examples, just as the rays of the sun penetrate without breaking or injuring in the least the solid substance of glass, so after a like but more exalted manner did Jesus Christ come forth from His mother's womb without injury to her maternal virginity."
"Catechism of the Council of Trent" 1566, Part I: The Creed, Article III
You also wanted to know about interpretations of this tradition. Some of the traditional sources use the image to refer to Christ's conception, not birth (Breeze). The primary concerns of traditional authors are
- Mary's perpetual virginity
- Reversal of the curse of Adam and Eve.
- That Christ's birth should not cause distress