A person suffering from diarrhea is exempt from tefilin (SA OC 38, KSA Tefillin 10:23). According to the lashon of the halacha, it is ok, or even obligatory, to wear them if one feels they can keep themselves clean for Shema and Amidah. See the KSA:
חוֹלֶה מֵעַיִם אֲפִלּוּ אֵין לוֹ צַעַר, פָּטוּר מִן הַתְּפִלִּין, מִפְּנֵי שֶׁאֵינוֹ יָכוֹל לִשְׁמֹר אֶת עַצְמוֹ בִּנְקִיּוּת כָּרָאוּי. וְאִם נִרְאֶה לוֹ שֶׁיָּכוֹל לִהְיוֹת בְּגוּף נָקִי בִּשְׁעַת קְרִיאַת שְׁמַע וּתְפִלַּת שְׁמוֹנֶה עֶשְׂרֵה, יָנִיחֵם אָז
A person suffering from diarrhea, although he has no actual pain, is exempt from the mitzvah of tefillin, because he is incapable of keeping himself properly clean. If he feels that he will be able to keep his body clean when reading the Shema and during the Shemoneh Esrei, he should put them on then.
My question is, if someone has taken a medication that prevents them from opening their bowels (and doesn't cause pain), are they still "exempt" for the rest of the tefillot, or are they now "permitted" or even "obligated" to wear the tefillin? On the one hand, they practically don't have diarrhea anymore, however it is just a temporary protection (even if it works for 24 hours), and technically they still do have the ailment.