I think drowning can be painless if it happens suddently ,by accident.
When i was a kid,i think i was 10,i went to one of those water parks.
Using one of the slides i entered the water in a bad way,basically face first.The pool was not that deep but i was disoriented underwater,didnt know where the surface was,eyes were closed and i was still shocked by the water slide.
The moment i went underwater i lost almost all perception of myself,of my body and the present,of all emotions.I was flying towards a golden light and it was so peacefull.
Then a friend saved me.He said i had my head underwater and my hands were desperatly slamming the water surface,so basically the body went on survival mode on automatic while i was almost to the other side.
So recap,i think that to be painless you need it to by an accident,with an adrenaline rush and probably low volume of air in the lungs