EDIT: It turns out I formulated this question out of a misunderstanding of my own old code. See @batFINGER and @scurest answers.
I'm working on a script which automates some animation, which includes turning on and off objects' viewport and render visibility with Object.hide_viewport and Object.hide_render. These objects will be created with the script.
In the Object Properties tab under 'Visibility', there is a button besides the 'Show in Viewports' and 'Show in Renders' buttons that allows these settings to show up in the Dope Sheet and be animated. I've attached a photo of these buttons, highlighted in red. How can I access these 'Animate property.' buttons with Python? As in what value do they change? Nothing shows up when hovering over this button with Python Tooltips on, nor does anything show up in the scripting info view when I click this button. Or is there an alternate way to do this?