One advantage of a Synth or electronic piano is they often have a small hole, about 1/4 inch in diamater... The size of what is called a PHONE plug (Cause it is the plug used on old time Telephone switchboards) Now most headphones today use a plug that is defined in mm but it's about 1/8th inch..... You can get an adapter and plug in so only you hear what you play.
Another advantage of the electronic piano/synth is the VOLUME control.. Play pianasimo even if hitting the keys Forte.
As for me, I always turn the volume down when I play and only do it outside of quiet hours. It would be no louder than someone playing a radio or music from their phone on a bluetooth speaker at a reasonable low volume.
Used to bring my 64 key Yamaha with me. Fit great in the bedroom on the side "bureau." I'd sit on a small stool and play with headphones - sometimes used the mic, which that keyboard could provide vocal harmony with.
Now, I simply bring my guitar and play it outside, inside, etc. Meet good folks quite often as a result as well as other strummers (who are also good folks - usually LOL).
I leave my keyboard at home but I usually travel with two or three guitars, mostly because they're my favorites and I can't stand to leave them home gathering dust. Some of my best songs have come to me when traveling.
I usually take my dobro in case there are others to play with. One of the guys that worked for me at Yellowstone had an 88 key electric piano in place of a sofa and played show tunes. I did not offer to accompany him.