共通パス名:os.path.commonpath(パスのシーケンス) は,パスのシーケンスの共通部分を返します.
import os.path
bin = '/usr/local/hoge/bin'
lib = '/usr/local/hoge/lib'
help = '/usr/local/hoge/help'
paths = [bin, lib, help]
common = os.path.commonpath(paths)
print(common)
/usr/local/hoge