Safely Accept Bitcoin Payments with 0 Confirmations
How is it possible to guarantee a transaction against double-spend, expiration or other fraud before it is confirmed by the Bitcoin network?

It isn't really possible in the absolute sense, but you can could perhaps create an insurance fund of sorts, to help provide guarantees against the rare occasion one of your customers is defrauded.
However you fundamentally cannot know for certain whether or not any specific transaction will be confirmed, until it has been. Even if a transaction has been seen by every node on the network, a miner could craft a conflicting transaction, and include it in their next block (with a success rate equal to their percentage of the hashpower). No amount of risk analysis can change this fact.

What kind of &quot;risk analysis&quot; might be performed to achieve this result?

It is hard to say for certain.
You could attempt to track where transactions originate from, like for example if you see transactions coming from large exchanges or service providers that are well-known and trusted in the community. Those entities are probably less likely to attempt a double spend.
You could watch for transactions marked as 'replace-by-fee' (RBF), which is a technique employed by many wallets, which allows the user to increase the fee-rate on a transaction for faster confirmation. Transactions marked as RBF could be treated as less trustworthy in regards to 'zero-confirmation' assurances.
There are likely other ways as well, those are the first couple that come to mind.