When Pvariable types contain template arguments with :: (e.g.
Automation<std::optional<bool>>), the namespace extraction logic
incorrectly split on :: inside the template params, producing
invalid C++ identifiers like Automation<std__automation_id__pstorage.
Fix by stripping template arguments before extracting the namespace.
Extract the logic into a testable _extract_component_ns helper.