Optimize `isEqual` by using `keys` and ensure `arguments` objects are compared correctly.