I wonder if it is possible to devise something for FPC so that it optimizes in a manner similar to LD/LLD "Identical Code Folding (ICF)"
This may be useful for code with generics
It is outstanding idea, however you can pull the feature request to the fpc in gitlab.