ENH: Consolidate and further improve performance of take functions
ENH: optimize Cython take functions with memmove where possible