I found how to do it for invisible pins but still now how to do it for visible ones:
// Prints a custom error
UFUNCTION(BlueprintCallable, Category = "Custom", meta = (WorldContext = "worldContextObject", ShowWorldContextPin))
static void PrintError(UObject* worldContextObject, const EErrorLocationType ErrorLocType = EErrorLocationType::NameOnly, const FString errorMessage = "Cast failed.");
ShowWorldContextPin does not work and neither does it when putting it in the UCLASS() but at least I can default to self. But I can’t seem to be able to expose the pin VISIBLY.