PERF: improved performance of compatible pickles (GH6899)