HF_from_C and some polymorphic inheritance code optimization