If you want to learn how to understand the performance of the whole system I can recommend Brendan Gregg's Systems Performance: Enterprise and the Cloud (https://www.brendangregg.com/blog/2020-07-15/systems-perform...). It is a good book that teaches a lot of basics and techniques and gives a good understanding of the impact different system components can have on performance.
Even in the US the case law around self-incrimination due to forced password disclosure does not seem to be settled. There have been multiple cases were judges have considered passwords foregone conclusions, e.g. [1]
I can recommend https://realpython.com/products/cpython-internals-book/ as a decent initial documentation of cpython. I have a copy of this book at my desk for the few cases when I need to debug GIL or memory allocator related issues in cpython.