Royal Mail’s maintenance of the Postcode Address file is governed by section 116 of the Postal Services Act 2000: Postal Services Act 2000 . The Government could simply nationalise it if they wanted to, presumably paying Royal Mail some compensation for their loss.
The compensation wouldn’t need to be too great, since the unit that runs it has a ring-fenced budget and the PAF pricing is already regulated to limit profits. A significant chunk of the income presumably already comes from the Government for the Public Sector Geospatial Agreement anyway.
The PAF only works because local authorities are mandated to provide address details of new builds etc. to which OS then adds coordinates and Royal Mail adds postcodes. If the Government wanted to be sneaky, they could require that data from OS and the Local Authorities is only supplied to Royal Mail under a copy-left database licence. At some point the new data becomes a significant chunk of the PAF and it can then only be distributed under an Open Licence.