It is fine if you just open PR (technically you have to create an issue for this and the PR that linked the issue, may be you find interesting to check Python Developer’s Guide).
I’m not a codeowner for GC or core-dev, so I just can give you some suggestions, but last decision will be to core-devs.
First, you don’t need to introduce m variable you can use stats→collected and stats→uncollectable.
Second, I propose to add time measurements to _PyGC_Collect this will not be 100% equal to 3.13 version, but IMHO more appropriate here.
So, create the PR and let other devs review your solution. Feel free to ping me you have some questions.