Millimeter observations of CO gas in planetesimal belts show a high detection rate around A stars, but few detections for later type stars. We present the first CO detection in a planetesimal belt around an M star, TWA 7. The optically thin CO (J=3-2) emission is co-located with previously identified dust emission from the belt, and the emission velocity structure is consistent with Keplerian rotation around the central star. The detected CO is not well shielded against photodissociation, and must thus be continuously replenished by gas release from exocomets within the belt. We analyze in detail the process of exocometary gas release and destruction around young M dwarfs and how this process compares to earlier type stars. Taking these differences into account, we find that CO generation through exocometary gas release naturally explains the increasing CO detection rates with stellar luminosity, mostly because the CO production rate from the collisional cascade is directly proportional to stellar luminosity. More luminous stars will therefore on average host more massive (and hence more easily detectable) exocometary CO disks, leading to the higher detection rates observed. The current CO detection rates are consistent with a ubiquitous release of exocometary gas in planetesimal belts, independent of spectral type.