There is this thing called "Gaming Bladder". (I have also recently learned that this also applies to operating room staff and they call it "O.R Bladder".)
With gaming bladder, you are playing a video game that has you so focused, you don't sense that your bladder wants you to pee. For operating room staff, it's being so focused on the surgery that you don't feel the urge to pee.
This is something that I have found works for both distracting me from needing to pee or poop. It also helps distract me from some of the pain I am experiencing.
I have heard from other people that there are other activities that can be like that, where the person is so focused on painting that they don't notice the urges or some pain.
I believe, as long as you are having some bowel movements in a day, like say you are only having 5 instead of 11, you should be able to avoid getting constipated. I can't say for sure because everyone's body is different.