All good points. One thing to note is the commonality of those instruments: both are string instruments where you can control the volume of notes individually at the time of its attack but where the basically long decay is pretty much predetermined and you basically can only dampen the note at some point of time (the guitar has slightly more ways for that, though).
It is also interesting to consider a few chimeras: there is the fretted clavichord which has fewer than one string per note and thus can also only play a limited number of chords. There is the autoharp which has dampers in chord arrangement but is strummed manually.
It is also worth noting that there are several piano keyboard arrangements which share the guitar's trait of transposability of chord shapes, like Janko keyboards, and the more ubiquitous chromatic button accordion keyboards.
Chromatic button keyboards (which are available as full-size keyboards with velocity control, like the old Ketron MS80) are not really suitable for "pianoforte" kind of play where an actual striking action is initiated by a key and the loudness depends on its force: due to the "shaping" your hand needs to do, controlling loudness in addition would be hard. Similar to how it is done with guitars, loudness control on actual accordions (rather than accordion-style flat keyboards) is left to the other hand (in this case the left). While the left hand also has to deal with chord buttons, their fingering is much more simplistic than that of the melody hand.
Another note: you point out that one can do pitch bending on a guitar in spite of its fretting. One can also do vibrato (which is quite more subtle than on unfretted string instruments). Surprisingly, a similar action on an acoustic piano key has a very very subtle but not entirely inaudible effect as well though probably not through pitch variation. The same action on an accordion is (again somewhat misleadingly) called "vibrato", is less subtle and more obvious to understand since it obviously transfers to the bellows action.
And of course in some modern music, (grand) piano players are expected to pluck some strings manually as well.
At any rate, one distinguishing feature of the piano is that the sound production and its manipulation are separated through levers, making it possible to "design" the keyboard. This separation is present in other instruments as well, like the celesta or the harmonium. To some lesser degree, some monophonic wind instruments use an arrangement of holes and levers to give an approximation of a diatonic scale augmented with "black keys" (if the underlying scale is not C major, those tend to be a candidate for transposing notation). Even things like xylophones tend to use a diatonic black/white arrangement of notes.
With the exception of the chromatic button accordion I don't really know any instrument with "decoupled keyboard" where a regular chromatic arrangement with constant chord shaping would be in significant use these days. The diatonic+semitones arrangement seems to have won except where dictated by physics, like directly fingered string instruments.
A guitar is, for all its size, a very portable and versatile instrument. Even the smallest accordions weigh a multiple. The most portable instrument with a "keyboard" would likely be a hurdygurdy, but then they are not in much use any more.