The idea of "no pain in birth" sources generally to the Infancy Gospel of James. And to those like Marcion, Valentinus, Apelles, and others who taught various ideas about Jesus' flesh. These were the docetists.
Here's the Infancy Gospel of James.
Then said Salome: As the Lord my God liveth, unless I thrust in my finger, and search the parts, I will not believe that a virgin has brought forth. 20. And the midwife went in, and said to Mary: Show thyself; for no small controversy has arisen about thee. And Salome put in her finger, and cried out, and said: Woe is me for mine iniquity and mine unbelief, because I have tempted the living God; and, behold, my hand is dropping off as if burned with fire. Infancy Gospel of James
Prior to this, a bright light had appeared in the cave. It receded and the infant appears at Mary's side. This "virginal birth" gave rise to the subsequent belief that Jesus was born from the east gate, not the south gate (Eze 44:1-2).
The idea relating this birth to light passing through glass or water through a tube sources to Valentinus, et al.
Some, however, make the assertion, that this dispensational Jesus did become incarnate, and suffered, whom they represent as having passed through Mary just as water through a tube;
enter link description here
So, the idea of a painless birth arose apart from scripture in denying the natural flesh of Christ. Centuries later the idea of a miraculous painless birth became "orthodox".