Resolving firmlinks in Python

I recently had the need to resolve firmlinks in python. For example given a path like /Applications/, I needed to get /System/Volumes/Data/Applications/

Turns out there is not a single example of this anywhere online, so if you are in the same place as I am, here is an example of how to do that: