I'd almost always prefer the sound of an old, out-of-tune piano, but there are certain times when keyboards are preferable to pianos. For example, when one of my pre-professional students recently accompanied an off-Broadway production of Hamilton, she needed to bring her own keyboard to the rehearsals and the show. So I loaned her my own Yamaha P-45 keyboard.
I recommend keyboards in general to anybody who values portability or affordability (they never have to be tuned or re-tuned). Plus, if you're just starting out, buying a new piano can seem like an enormous investment. Here I'm recommending the Yamaha P-45 wholeheartedly to my beginning students because I've used it on gigs before, and I believe it is the most affordable of all the 88-key, weighted digital pianos. It possesses all the basics of a piano without too many bells and whistles.
I personally like that it has built-in speakers because you can just plug it in anywhere and start playing without an amplifier. You can use headphones (I always recommend "over-the-ear", not earbuds).
Here's the product description from Amazon: "The P-45 is the lowest-cost, 88-note weighted-keyboard digital piano that Yamaha offers. This digital piano has a basic set of features, ideal for the needs of the beginner piano student."