Does Optimizely have something built in that I could call to log some data without having to build my own system that logs to a custom database/blob storage?
If you are using CMS 12 and above in DXP environment logging will be setup and configured for application insights.
As with many subsystems in CMS, logging can be done by custom provider that logs to wherever you like. You can create a provider that log to a custom database Write log messages (optimizely.com)
If you use either the classic Episerver.Logger or the new Microsoft.Extensions.Logging, then you are logging the same way as the platform. And then you are free to configure where the logs should go.
For DXP you are contractually bound to have those logs sent to Application Insights. For other hosting models you can use whatever you want. Like log4net, Serilog (to text files, database, New Relic, Syslog, etc), Splunk or something else.
So there is no built-in way to do this. But no restrictions either.