So, rereading your explanation and the article on python garbage collection, I think any actual code reference has to be the actual python code, so if necessary, it's here: https://github.com/python/cpython/blob/main/Modules/gcmodule.c (I mostly like code references to steal variable names...)
But I would say to stick to the concepts you narrowed down in your comment, which I think is a good reference for the AGS version of a GC.
The MicroPython code - lets call it just MP to avoid confusion - is doing something a bit different, which I think is some optimization on top of a Mark and Sweep implementation. A note that like, 20% of issues from MP are Garbage collector related - it seems it matters a lot in embedded systems. The Mark and Sweep in the wikipedia article on GC, it looks like it's the basic GC to implement - not optimal but reasonably minimal. There is a good visual in the article for it.
But I would say to stick to the concepts you narrowed down in your comment, which I think is a good reference for the AGS version of a GC.
The MicroPython code - lets call it just MP to avoid confusion - is doing something a bit different, which I think is some optimization on top of a Mark and Sweep implementation. A note that like, 20% of issues from MP are Garbage collector related - it seems it matters a lot in embedded systems. The Mark and Sweep in the wikipedia article on GC, it looks like it's the basic GC to implement - not optimal but reasonably minimal. There is a good visual in the article for it.