DEV: Reduce repeated code in discourse_plugin_registry (PR #9705)

Add a helper method to simplify creating a new register. Previously this would require creating lots of different methods in the registry

In future I would like to DRY up the register_ methods as well.

GitHub