With a "MIDI keyboard", you are not going to learn the basics of piano but rather of keyboard play. Basically all keyboards that have action seriously suitable for actual piano play also have their own sound generators and more often than not built-in amplifiers. While they may also sport MIDI output, using that is optional and, short of rather high quality MIDI expanders, unlikely to lead to better results.
Number of keys depends on what you want to be playing: for classical piano pieces, anything but 88 is going to lead to chagrin eventually even though the outer keys will see less than 0.1% of the action the middle C does.
For rock piano, you'll usually arrange to make do with what you have. In that case, genuine piano action is less important as well, as are faithful tone production. You still want some mechanical action, and some manufacturers already call "feels totally unweighted but has velocity detection" semi-weighted. Which tends to end up dissatisfactorily mushy even for rock piano.
For "toying with music production", piano capabilities are likely to take a second seat to good sound generation. You don't want to depend on your laptop for that: competitive software MIDI expanders tend to be expensive. If you take what your operating system offers for free, you can expect a good 30 year old vintage keyboard with its own sound generators and MIDI input/output to produce better sound quality.
A two decade old Ketron/Solton MS-40 expander (or its greater cousins including a keyboard and hard disk, MS-80 (accordion button keyboard) and MS-100 (piano keyboard)) has embarrassingly better (and more complete) sounds than what you get with typical free sound fonts. Some "instruments" may be on the synthetic/cheesy side, but they are assembled into a consistent and playable and responsive set, something which seems harder to do for the distributed piecemeal work going into free or semi-free offerings.
I think at the current rates a good vintage expander sets you back about 1/2 to 1/3 of a comparably quality modern offering, being much more bulky and less versatile. And their signal paths are analog, so for wholesale production work they would not be really called for. They are still a lot more fun to play with than modern cheap stuff.