LGTM, seems easy enough to be worth fixing. Maybe comment why it's useful, 'cause I'm way too much of a C developer not to feel like removing the cast one day or another :)
BTW it's probably a good idea to add this cast for C as well, so people developing on GTK3 yet using those will use the right variable type or get a warning.