The documentation shows how you can put code in .py files and add them to the cluster as a ConfigMap and then make use of the code in the Composition. Unfortunately the crossplane package format does not support adding ConfigMap resources to the packages making it impossible to make a Configuration package without adding the code inline in the Composition.
Would it be possible to add support for packaging the code as part of the Configuration package by adding a new CustomResourceDefinition.apiextensions.k8s.io called CodeMap or similar that can include in the package?