The coincident detection of GW170817 in gravitational waves and electromagnetic radiation spanning the radio to MeV gamma-ray bands provided the first direct evidence that short gamma-ray bursts (GRBs) can originate from binary neutron star (BNS) mergers. On the other hand, the properties of short GRBs in high-energy gamma rays are still poorly constrained, with only $sim$20 events detected in the GeV band, and none in the TeV band. GRB~160821B is one of the nearest short GRBs known at $z=0.162$. Recent analyses of the multiwavelength observational data of its afterglow emission revealed an optical-infrared kilonova component, characteristic of heavy-element nucleosynthesis in a BNS merger. Aiming to better clarify the nature of short GRBs, this burst was automatically followed up with the MAGIC telescopes, starting from 24 seconds after the burst trigger. Evidence of a gamma-ray signal is found above $sim$0.5 TeV at a significance of $sim3,sigma$ during observations that lasted until 4 hours after the burst. Assuming that the observed excess events correspond to gamma-ray emission from GRB 160821B, in conjunction with data at other wavelengths, we investigate its origin in the framework of GRB afterglow models. The simplest interpretation with one-zone models of synchrotron-self-Compton emission from the external forward shock has difficulty accounting for the putative TeV flux. Alternative scenarios are discussed where the TeV emission can be relatively enhanced. The role of future GeV-TeV observations of short GRBs in advancing our understanding of BNS mergers and related topics is briefly addressed.