This inlines and reorganizes code in the `json_encode` dispatch. The main benefits of this are: - Move less common types into a separate function - Inline the common type dispatch in collection types where the value is likely to be uniformly typed. This includes `list`, `set`, `dict`, and `tuple`, but excludes structured data types like `struct`/`dataclass`. This results in a 12% perf improvement on common benchmark datasets. I think this is due to a mix of improved locality and branch prediction. Inlining results in each collection type having its own copy of the common branches, which the branch predictor will track separately. This means that encoding a `dict[str, list[int]]` type will have `json_encode_dict` predicting to take the `list` branch and `json_encode_list` predicting to take the `int` branch. This change is definitely biased towards benchmark gaming, but I've also tested it on some real world workflows and at worst it doesn't result in a regression (and usually it results in an improvement).