GROOVY-6466 && GROOVY-6467: move some code for casting into InvocationWriter, provide variants for static compiler and indy of this, disable Log4j2Tests on indy, modify some static compilation tests if indy is used as well to reflect the different bytecodde, introduce ShortTypeHandling for some short type conversion paths and some minor code clean up. This commit also deprecates several internal methods, that should not be used anymore if possible