You are correct that there is no way for your plugin to register a direct JS method to be called directly.
The way that 3rd party developers have been doing this for almost 15 years now is the execMenuItem solution that you describe below, using global variables in JS as the data passing mechanism.