This is the XML for the Pragmatic ideology choice that prevents anyone from declaring war upon you for 50 turns:
<Trait>
<InternalName>NegotiatorTrait1</InternalName>
<DisplayName>NegotiatorTrait1_Name</DisplayName>
<ShortDescription>NegotiatorTrait1_ShortDec</ShortDescription>
<Description>NegotiatorTrait1_Dec</Description>
<Icon>Negotiator1_Hot.png</Icon>
<DisabledIcon>Negotiator1_Disabled.png</DisabledIcon>
<AICategoryWeight>
<Military>3</Military>
<Growth>7</Growth>
<Tech>6</Tech>
<Diplomacy>10</Diplomacy>
<Expansion>9</Expansion>
<Wealth>5</Wealth>
<Influence>8</Influence>
<Fortification>4</Fortification>
</AICategoryWeight>
<Triggers>
<OnEvent>OnCultureTraitUnlock</OnEvent>
<Target>
<TargetType>Faction</TargetType>
</Target>
<Lifetime>Target</Lifetime>
<Duration>50</Duration>
<Modifier>
<EffectType>ImmuneToWar</EffectType>
<Target>
<TargetType>Faction</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Modifier>
</Triggers>
</Trait>
I'd start working from this and try creating a galactic event that triggers on game start that lasts for however many turns you want it to and applies to everyone. I suspect that the highlighted area is where you want to work; the <Trigger> needs to be changed to something at game start and I'd suggest trying to add <Scope>Global</Scope> before the <Target> line.